Timmer - timeout a section.
Hi everyone,
I designed a quiz application for client. It works fine, it keeps track of score, which questioned was missed, etc. Now my client would like me to make this quiz timed. He wants the user to only have a certain amount of time for finishing the quiz, if he doesnt finish it in the allocated time, he needs to start again.
I found some information on using Timers. I made a little test and it works fine. I am just not sure if this is the correct way to achieve what I am trying to accomplish. Also, how can I make a clock, so that the user can see how much time he has left, or how much time he has used?
This is a sample of the code I have so far. I just have the timer start, and then I have a box pop up after the time runs out:
screenBox.visible = false;
var mainTimer:Timer = new Timer(500,5);
mainTimer.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener (e:TimerEvent):void{
trace("Timer is Triggered");
}
mainTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerDone);
function timerDone(e:TimerEvent):void{
trace("Timer finishing!");
screenBox.visible = true;
}
mainTimer.start();
Thank you!!!
