Question
How Do You Stop a Function (k)
I have this code placed in the second frame of my timeline.
It is there
to pause the playhead for 4 seconds before moving onto the next frame.
Problem with the code is that once the statement is true it keeps
jumping ahead doing a perpetual nextFrame.
I want to reset the variables and stop the function. I have no idea what
I am doing.
//
startTime = getTimer();
trace("startTime "+startTime);
this.onEnterFrame = function() {
currentTime = getTimer();
//4000 below = 4 seconds
if (currentTime-startTime>4000) {
nextFrame();
trace("currentTime "+currentTime);
}
};
to pause the playhead for 4 seconds before moving onto the next frame.
Problem with the code is that once the statement is true it keeps
jumping ahead doing a perpetual nextFrame.
I want to reset the variables and stop the function. I have no idea what
I am doing.
//
startTime = getTimer();
trace("startTime "+startTime);
this.onEnterFrame = function() {
currentTime = getTimer();
//4000 below = 4 seconds
if (currentTime-startTime>4000) {
nextFrame();
trace("currentTime "+currentTime);
}
};