I am trying to achieve a reverse countdown with flash scripting. I got up to the following code: var counter = 15; this.onEnterFrame = function () { setInterval(printime,1500); } function printime() { if(counter > 0){ counter = string(counter - 1); timer_txt.text = counter; } else { timer_txt.text = "Test"; stop(); } } Code (markup): * I want it to take a second to reload each number, it does it for 15, then everything else high-speed (I couldn't find a sleep function for flash). * When the end comes, it shows nothing instead of "Test". There is a dynamic text field called timer_txt. Script is in "Action" layer and the textbox is in it is own layer (I also tried putting the script+textbox within the same layer). Thanks for the help beforehand, Peace,
Hi, Here's the problem: this.onEnterFrame = function () { setInterval(printime,1500); } You shouldn't put the setInterval inside onEnterFrame, it should be like this: myInt= setInterval(printime,1500); then when counter reaches zero, you clear the interval with this line: else { timer_txt.text = "Test"; celarInterval(myInt); stop(); }