Saturday, 24 May 2008

Countdown timer

In this Flash tutorial you will learn how to create a countdown timer in Actionscript 2.0. Countdown timers can be used in multimedia applications, games etc. For example, a countdown timer can be used to simulate a rocket countdown or a countdown timer in game. The end results of the countdown timer will show numbered values decrementing every second.

UPDATE: Countdown timer in Actionscript 3.0 version now available.

Countdown timer

Step 1

Create a new Flash document.
Select the Text tool with static text and type your message on the stage. I have typed the message 'CountDown', but you can type whatever message you wish.

Step 2

Select the Text tool with dynamic text and drag a small box shape like below:

Step 3

On the timeline right click on the first frame of layer 1 and select 'Actions' and enter the following lines of code in the Actions panel:

count = 60;
countdown = function(){
if (count ==0){

doCountdown = setInterval(countdown, 1000);

**The current count is 60 seconds, but you can change it to whatever you wish. This code contains the cleartInterval() method which stops the function call. And also contains the setInterval() method which calls the time in milliseconds.

Step 4

Using the Selection tool (V) select the dynamic text box and enter the variable “count” in the properties tab. The variable creates a reference to the dynamic text which will display the countdown times.

Step 5

Test your countdown timer Ctrl + enter. You should now see a countdown from 60 seconds.

You should now have a countdown timer in Actionscript 2.0. Feel free to contact me for any questions or comments and remember to subscribe.


Anonymous 9 July 2009 at 03:37  

Thank you.

Anonymous 5 January 2010 at 00:32  

Hi thank you for sharing. Im a beginner in Flash.
Can u also share how you did the reset for this?

Supha Issarang 2 March 2013 at 18:48  

it works :) Thanks

But if i want to go to the next frame when the time is zero
, what code would it be ?

iliketo 3 March 2013 at 12:16  


Use the gotoAndStop() method.

  COPYRIGHT © 2014 · ILIKE2FLASH · Theme by Ourblogtemplates

Back to TOP