I’m having a setInterval AS3 problem.Let me explain: I’m making a game with a timer, lets for example give its instance, timer1.every 500 milliseconds timer1 moves to left 25 times (timer1.x-=25) and when timer1 hitTests finish1 (if(timer1.hitTestObject(finish1))) it goes to the you lose scene.and you have to replay the level.When I hit replay and enter the scene the speed increases in the setInterval by double and if I lose again, triple and so on.How do fix this? It’s very important that I have it fixed soon.thanks
Share
Sounds like multiple instances of
timer1are continuing to run.1 instance of
timer1runs at original speed.2 instances of
timer1runs at double speed.etc.
Ensure that the original
timer1is stopped, deleted or killed off before changing scene.You may want to reference the function
clearInterval.