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
Printable View
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
You can use the Timer class. Have an event that advances to the next frame every three seconds
@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");
}
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.
Thanks again
NP. Make sure to mark this thread as resolved from the Thread Tools.