Countdown timer
Step 1
Create a new flash document.
Using the static text tool write your message on the stage.
Step 2
Select the dynamic text tool and drag a box shape like below:
Step 3
On the timeline right click on the first frame of the layer 1 and hit F9. Enter the following lines of code.
count = 60;
countdown = function(){
count--;
if (count ==0){
clearInterval(doCountdown);
}
}
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 stop 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.
Step 5
Test your movie Ctrl + enter.
You should now have a count down timer.






0 comments:
Post a Comment