# How to stop Counter and Timer

**URL:** <https://forum.kirupa.com/t/how-to-stop-counter-and-timer/328802>\
**Category:** Uncategorized\
**Created:** [June 18, 2012, 3:37pm UTC](https://forum.kirupa.com/t/how-to-stop-counter-and-timer/328802 "2012-06-18T15:37:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertochampa](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@robertochampa](https://forum.kirupa.com/u/robertochampa)\
**Post date:** [June 18, 2012, 3:37pm UTC](https://forum.kirupa.com/t/how-to-stop-counter-and-timer/328802/1 "2012-06-18T15:37:10Z")

</div>

hello,

i have a simple Timer - wich counts down from 10 to zero  
than a interval counts too for 10 seconds and than goto another frame.

but when i go faster to another frame the counter doesnt stop

so: How to stop the simple Timer:

that doest work:

clearInterval(intervalID);  
clearInterval(gocountdown);  
clearInterval(counter);  
delete this.onEnterFrame;  
delete counter.onEnterFrame;  
clearInterval(countdown);  
clearInterval(i);  
clearInterval(n);

here is timer function

count = 10;  
countdown = function(){  
count–;  
if (count ==0){  
clearInterval(doCountdown);  
}  
}

doCountdown = setInterval(countdown, 1000);

and this is the interval function:

stop()

```
var myinterval:Number;

```

function goto() {  
gotoAndPlay(1);  
for(i=3;i\<=5;i++){  
delete \_root[“var”+i];  
}  
clearInterval(myinterval);  
}  
myinterval = setInterval(goto, 10000);

see fla below
