all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

Need some help with Actionscript for Timing Out



Need some help with Actionscript for Timing Out BillD222
3/2/2005 10:32:34 PM
flash actionscript: Hi, I am developing a short interactive quiz. In the background I have an
actionscript running that is supposed to time out and restart the quiz within
60 seconds if the user doesnt answer the question or walks away or stops
playing. The time out part works, but the problem is that I cant stop it once
it begins, so it times out within 60 seconds even if the user has moved on to
the next question. Here is the script I am using at the begining of the movie
on Frame 1: function wait60() { stop(); var myInterval = setInterval(function
() { gotoAndStop(1); clearInterval(myInterval); }, 60*1000); // stop for 60
seconds }{ then on each frame where I want the time out to occur I have the
function called wait60(); How do I reset or clear the function so that
it doesnt repeat itself or continue after the user restarts game? It doesnt
seem to clear. I have been searching and experiment but I haven't been able
to solve this. I'm sure this must be possible, any thoughts? Thank you so
much,
Re: Need some help with Actionscript for Timing Out kglad
3/2/2005 10:52:00 PM
reset by executing:

clearInterval(myInterval);
wait60();

Re: Need some help with Actionscript for Timing Out BillD222
3/3/2005 4:44:45 PM

Thank you so much, it worked!

Re: Need some help with Actionscript for Timing Out kglad
3/3/2005 8:42:44 PM
AddThis Social Bookmark Button