flash as2 question
flash as2 question
- Started
- Last post
- 5 Responses
- fyoucher10
You need to clear the timeout first, otherwise you'll have multiple timeouts triggering...
var delay_to:Number;
function pause(num:Number):Void {
clearTimeout(delay_to);
delay_to = setTimeout( function():Void { nextFrame(); }, num * 1000);
}Then when you want to call it, call >>>
pause(4);- ... you may need to add the stop() to that functionfyoucher1
- CygnusZero40
^ I honestly dont know Flash that well. All that code you just posted, I have no idea where it goes.
- fyoucher10
Put this on the 1st frame somewhere >>
var delay_to:Number;
function pause(num:Number):Void {
clearTimeout(delay_to);
delay_to = setTimeout( function():Void { nextFrame(); }, num * 1000);
stop();
}Then instead of of adding your setTimeout function and stop on EACH frame, add this >
pause(4);
- err0
you should post the FLA. I will fix.
- CygnusZero40
^ Worked man, thanks.