Hi
I am doing this game in flash 8 proffesionel, but my timer creates a lot of problems. I have been looking everywhere for help, but without any luck.
First I placed a dynamic textfield at frame 1 on the main timeline stage called: mySeconds in the var field.
and placed the value 0 in the textfield on the stage.
Then I wrote this code by opening the actionscript panel at frame 1 on the main timeline:
stop();
function wait() {
mySeconds++;
if (mySeconds == 90) {
gotoAndStop(70);
}
}
myTimer = setInterval(wait, 1000);
Then I place a keyframe on frame 10, 20, 30, 40 50, 60 and 70 where the player is taken to each of these keyframes during the game.
I want the timer to stop on frame 40, 50, 60 and 70 so I put this code on frame 40, 50, 60 and 70:
onEnterFrame = function(stoppo) {
clearInterval(myTimer);
myTimer = setInterval(wait, 1000);
}
the above code stops the timer, so until now the timer works great, BUT when I then write: gotoAndStop(1) after the code on frame 40, 50, 60 and 70
so the movie begin playing frame 1 again, then my timer goes crazy.
Does anybody know how to make a timer who will work in my kind of game?