So been working on a simple quizz game and faced an unexpected problem that neither even hours of googling nor endless usage of the search tool couldn't had helped. In the attachment there's the issue excluded. You see each time you click "Next" the old timer countdown is added to the new countdown
The issue is that I can't get the timer from running on background. Obviously missing a specific code to stop it from running but apparently can't get any of them to work on that one.
The timer has a code of
Quote:
timer = 30;
countdown = function(){
timer--;
if(timer==0){
delete onEnterFrame;
clearInterval(countdownInterval);
_root.gotoAndPlay(2); // (don't mind this one)
gotoAndPlay(1);
}
}
countdownInterval = setInterval(countdown,1000);
|
Button has the code of
Quote:
on (release) {
_root.tekstilaatikot_mc.kys_vaarin_1_mc.gotoAndSto p(12);
_root.timerii_mc.gotoAndStop(1);
_root.tekstit_mc.nextFrame();
_root.voitit_mc.gotoAndStop(2);
gotoAndPlay(2);
}
|
And couldn't had found the solution how to make the timer from running on background. I think it's because both the buttons and timers are covered by seperated movie clips but that's needed on the project
Thanks and sorry if this sounded stupid