How To Make Countup And Countdown Timer In Flash With Action Script 2.0

Views:
Friends now i sharing a simple trick to make countup and countdown timer in Adobe Flash with action script 2.0. Flash is a 2D animation software that help to produces both timeline animation and also it support scripts. That is called action scripts. but some time we are unable to do animations with script that because of coding error. now i share a simple countDown CountUp timer in Flash Follow below steps.

Demo




First open Adobe Flash with Action Script 2.0.

Count Up Timer


  • Select Typing tool ( T ) and drag on stage.

  • In Properties select DynamicText option.
select dynamic text

  • Click on Embed option.Select Numerals.
numerals

  • In options type “ timer ” in variable column.
variable

  • Now create a new layer in timeline.
create new layer

  • Click on first frame of new layer.

  • Click on F9 button on key borad.Now appear a window.
script timer

  • Type below script on that Window.


timer = 0;
countup = function(){
    timer++;
}
countupInterval = setInterval (countup,1000);


If you want to stop timer at 100. copy below code.


timer = 0;
countup = function(){
    timer++;
if (timer>=100) {timer=100;}}
countupInterval = setInterval (countup,1000);



Count Down Timer


  • Select Typing tool ( T ) and drag on stage.

  • In Properties select DynamicText option.

  • Click on Embed option.Select Numerals.

  • In options type “ timer ” in variable column.

  • Now create a new layer in timeline.

  • Click on first frame of new layer.

  • Click on F9 button on key borad.Now appear a window.

  • Type below script on that Window.

Timer starts at 100


timer = 100;
countdown = function(){
    timer--;
}
countdownInterval = setInterval (countdown,1000);


If you want to stop timer at 0. copy below code.


timer = 0;
countdown = function(){
    timer--;
if (timer>=0) {timer=0;}}
countdownInterval = setInterval (countdown,1000);









If you having any doubt comment below…
How To Make Countup And Countdown Timer In Flash With Action Script 2.0 How To Make Countup And Countdown Timer In Flash With Action Script 2.0 Reviewed by Gaint Hackers on 05:09 Rating: 5

No comments:

Powered by Blogger.