-
[RESOLVED] Automatically goto next frame for slideshow
Hi,
I'm trying to advance to the next frame after 3 seconds on my timeline using actionscript 3. Is there a way to do this? I have 1 image per frame on my timeline.
Thank you,
Bill
-
Flash/Flex Developer
You can use the Timer class. Have an event that advances to the next frame every three seconds
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
@samac1068 Thanks! I found this timer class online but don't really know how to implement it (I'm a beginner). How can I modify this to advance to the next frame?
var myTimer:Timer = new Timer(1000, 1); // 1 second
myTimer.addEventListener(TimerEvent.TIMER, runOnce);
myTimer.start();
function runOnce(event:TimerEvent):void {
trace("runOnce() called @ " + getTimer() + " ms");
}
-
Flash/Flex Developer
actionscript Code:
var myTimer:Timer = new Timer(3000); myTimer.addEventListener(TimerEvent.TIMER, threeSec); myTimer.start();
function threeSec(event:TimerEvent):void { this.nextFrame(); }
Just need to add the command within the function for the Timer. As long as the layer extends the length of the timeline then you should be good.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
-
Flash/Flex Developer
NP. Make sure to mark this thread as resolved from the Thread Tools.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|