flash as2 question
- Started
- Last post
- 5 Responses
- CygnusZero40
^ Worked man, thanks.
- err0
you should post the FLA. I will fix.
- 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);
- CygnusZero40
^ I honestly dont know Flash that well. All that code you just posted, I have no idea where it goes.
- 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
- CygnusZero4
Setting up a simple slideshow, Im not a flash expert. 10 photos, 10 frames, 1 frame per second movie.
Want each frame to hold for 4 seconds, then move to next frame. Using this code for that on EACH frame:
stop();
setTimeout(function(){ nextFrame() }, 4000);Also have previous/next buttons which I just want to jump forward or backward 1 frame. Using this code on the next button for example:
on (release) {gotoAndStop(_currentframe+1);
}Everything seems to work fine, except if I start clicking the next button pretty quickly, then the slideshow just starts moving fast, like its ignoring the gold for X seconds code all of a sudden. May not even be how fast Im clicking the button, but rather when I actually click it. I dont know. Any clues?