# Timer and Movieclip and Button, OH MY! Why is this not working?

**URL:** <https://forum.kirupa.com/t/timer-and-movieclip-and-button-oh-my-why-is-this-not-working/175664>\
**Category:** flash\
**Created:** [January 16, 2006, 9:40pm UTC](https://forum.kirupa.com/t/timer-and-movieclip-and-button-oh-my-why-is-this-not-working/175664 "2006-01-16T21:40:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamanthaLizK](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SamanthaLizK](https://forum.kirupa.com/u/SamanthaLizK)\
**Post date:** [January 16, 2006, 9:40pm UTC](https://forum.kirupa.com/t/timer-and-movieclip-and-button-oh-my-why-is-this-not-working/175664/1 "2006-01-16T21:40:31Z")

</div>

I’m so sad, I finally got my countdown timer working using this code

```auto
stop();
displayTime = 20;
countDown = function () {
displayTime--;
if (displayTime == 0) {
clearInterval(timer);
gotoAndPlay(2);
}
};
timer = setInterval(countDown, 2000);

```

And by placing a dynamic text field named displayTime in my frames. Works perfect! Problem is, I have a button that allows the user to skip the question ( \_root.chooser(); ) which goes to the next frame, however the timer speeds up, counting erratically, and sometimes even going to negative numbers.  
(on frame 2 there is a random chooser code that randomly picks frames a1-a100)

```auto
function chooser() {
ran = random(99)+1;
trace("a"+ran);
gotoAndStop("a"+ran);
}
chooser();

```

Help please!!!
