I’m so sad, I finally got my countdown timer working using this code
stop();
displayTime = 20;
countDown = function () {
displayTime--;
if (displayTime == 0) {
clearInterval(timer);
gotoAndPlay(2);
}
};
timer = setInterval(countDown, 2000);
And by placing a dynamic text field named displayTime in my frames. Works perfect! Problem is, I have a button that allows the user to skip the question ( _root.chooser(); ) which goes to the next frame, however the timer speeds up, counting erratically, and sometimes even going to negative numbers.
(on frame 2 there is a random chooser code that randomly picks frames a1-a100)
function chooser() {
ran = random(99)+1;
trace("a"+ran);
gotoAndStop("a"+ran);
}
chooser();
Help please!!!