Dear all,
As a bit of an AS beginner, I'm hoping to get some help with my timer, which I believe is preventing me from restarting my game.
The timer starts when the game starts, and counts down from 30 seconds. When the time's up, some game results are displayed, and a restart button (restart_mc) pops up. When this is pressed, the game tries to restart for about 1 frame, but the game then returns directly to the analysis screen.
I recon this is probably the timer, as when I test my movie (Ctrl + enter) does not reset the timer either. I have to actually launch a new test window.
Code:
beginCount=30;
if(!done){
time=Math.ceil(beginCount-getTimer()/(1000));
time_txt.text = time
if(time<0){
done=true;
interface_mc.gotoAndPlay(end)
time_txt.text = 0;
}
}
restart_mc.onPress = function(){
replay();
}
function replay():Void{
beginCount = 30;
time = 30;
done = false;
interface_mc.gotoAndStop(game);
trace("RRRRRRREEEEEEEWIND");
init();
}
Do I need a new timer, or just fix the resetting of it? Any help would be appreciated!
Blessings and praises,
Tom