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

Clear interval when a button is clicked

$
0
0

Hi all,

 

I'm on EA CC2015

 

Any idea on this ???

 

Frame 1 code (will go to play frame 3 after 5 seconds) <-- and it works :

 

sym.stop();

var counter_delay = 1000;

var min_count = 0;

var present_count = 5;

var timer = window.setInterval(stepUp,counter_delay);

function stepUp(){

present_count--;

// Change the text of an element

sym.$("Text").html(present_count);

if(present_count==min_count){

//alert("5 seconds over");

clearInterval(timer);

sym.play(3);

}}

 

Frame 1 button code (have to stop the counter and go to play frame 2) <-- it works, exept the counter is still running and will go to frame 3 after 2 or 3 seconds on the frame 2 :

 

sym.play(2);

//i have to put the code here for stopping the counter... (something that will tell the root to clear interval)

 

Thanks for your help...!!

 

-david


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>