Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

How to reset timer?

$
0
0

Hello,

i have a timer that counts down to zero when selected then advances the main timeline.

I would like it to repeat this action when the button is clicked again but the timer only works once.

Here is the code:

 

     var timerCount=4; // This is the variable set for the timer display

 

     var tCounter=setInterval(timer, 1000); //1000 will run the timer every 1 second

 

         function timer()

         {

           timerCount=timerCount-1;

           if (timerCount <= -1)

           {

          sym.getComposition().getStage().getSymbol("set_1").play();

            

              return;

           }

 

           sym.getSymbol("timer_sym").$("timer_txt").html(timerCount); // Display the timer value

 

           }

 

 

Any suggestions?

 

Thanks


Viewing all articles
Browse latest Browse all 9897

Trending Articles