Quote:
Originally Posted by neilmmm
setTimeout(mover, 500);
setTimeout is like setInteval but is called only once
so setTimeout calls the function mover in 500/1000 sec (ie 1/2 a sec) later. it is a short delay before the first one pops up. afeter that i call it every 1000/1000 sec (ie a second later) to get the next one up.
|
Ahha.. I see
Runned into another "problem" now, sorry about all this but I like to use the people that can help me when I got the chance!
Im using this code:
timer = 30
fcountdown = function () {
timer -= 1
if (timer<=0)
gotoAndStop(3);
}
myInterval = setInterval(fcountdown, 1000)
And it works perfectly because when it hits 0 it go to frame 3 as I want, BUT
when i press the button to restart the game, it go down -2 at a time, like I have started it twice.. and if I dont change frame it will keep going to -1, -2, -3 etc.
So I need this to stop at 0 and then restart when it come to frame 2 in the game.
Sorry for bad explain, its really late and I just wanted to post it before I went to bed.
Good night, and thanks!