# Pausing a setinterval countdown?

**URL:** <https://forum.kirupa.com/t/pausing-a-setinterval-countdown/260602>\
**Category:** Uncategorized\
**Created:** [May 17, 2008, 10:39am UTC](https://forum.kirupa.com/t/pausing-a-setinterval-countdown/260602 "2008-05-17T10:39:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![02simond](https://avatars.discourse-cdn.com/v4/letter/0/f19dbf/32.png) [@02simond](https://forum.kirupa.com/u/02simond)\
**Post date:** [May 17, 2008, 10:39am UTC](https://forum.kirupa.com/t/pausing-a-setinterval-countdown/260602/1 "2008-05-17T10:39:56Z")

</div>

Hi  
I have built a Music Player on my site with a pause function. I have also put a setinterval to make the songs change when they are done. The problem I now realized was that the setinterval timer kept going when I paused the songs. How do I pause the setinterval and then resuming it?

Here is the code that I have on the frames:

```auto
function wait() {               
    nextFrame();
 stopAllSounds();
    clearInterval(myTimer);
}
myTimer = setInterval(wait, 208000);
s2 = new Sound();
s2.attachSound("i_have_you_to_thank");
i=1;
function timeme (){
now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
_root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
_root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
i++;
}
s2.start();
timeme();

```

Thank you all for the help
