I need help with Timers
Hi all.. I posted a retardedly long problem last time and apologize for that. Now I am going to break the whole problem into little pieces. This post is regarding timers. I have 3 different banner images that have an "out" animation based on the timeline. I am trying to add a delay at specific points on the timeline. Here is my code for the first frame:
//TIMER
var moveFrame:int = currentFrame + 1;
stop();
var millis:Number=5000;
var Tim:Timer = new Timer(millis, 1);
Tim.addEventListener(TimerEvent.TIMER, playit);
function playit(e:TimerEvent):void {
gotoAndPlay(moveFrame);
}
Tim.start();
So this does exactly what i want at first... it waits 5 seconds, then it calls for the integer of moveframe which is currentFrame + 1. This then moves properly through the "out" animation and to the next banner which has this code:
stop();
Tim.start();
trace (moveFrame);
The problem is that the var Tim does not seem to follow the currentFrame + 1 idea (or more likely, I am not properly writing this script) in my head. I want to be able to reuse the timer script from frame one but i want it to add 1 to the current frame that I am on and play (say frame 10 is the second banner with the second portion of code I put down, I would want it to go to frame 11 utilizing the script from frame 1). Unfortunately, all it is doing is going back to frame 1 then adding 1 which is why my trace output is always 2 haha! Is there a way to reuse this type of timer code without having to call frame labels? I just want a true currentFrame + 1 solution. Thanks for your time.