# Problem with play and resume buttons with setInterval

**URL:** <https://forum.kirupa.com/t/problem-with-play-and-resume-buttons-with-setinterval/120849>\
**Category:** Uncategorized\
**Created:** [August 27, 2004, 9:09pm UTC](https://forum.kirupa.com/t/problem-with-play-and-resume-buttons-with-setinterval/120849 "2004-08-27T21:09:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pseudodigm](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@pseudodigm](https://forum.kirupa.com/u/pseudodigm)\
**Post date:** [August 27, 2004, 9:09pm UTC](https://forum.kirupa.com/t/problem-with-play-and-resume-buttons-with-setinterval/120849/1 "2004-08-27T21:09:44Z")

</div>

Basically, I have a presentation movie with a few complexities to it.

1. The movie Plays, then waits an interval of time, then resumes (works alright)
2. The movie needs to have a pause button (that will pause the action) and a play button that will resume the action.

My problem: Once I pause and then hit play the play button ignores the “countdown” of setInterval and just “skips” ahead to the next part.

I’m putting in a voice over and I really need that interval of time there or stuff will run into each other.

Can anyone help?

Here’s a sample of code:

On the first frame (but indicative of the rest):

```auto

stop();
/* Sound Stuff */
var mySound = new Sound(this);
mySound.attachSound("soundIntroduction");
mySound.start();
 mySound01.onSoundComplete = function()
 {
  _root.nextFrame();
 }
 
function wait() {              
 gotoAndPlay(2);
    clearInterval(myTimer); 
}
myTimer = setInterval(wait, 61000); 

```

The play button there’s a clearInterval in here, but without it the play button will keep repeating everything. I guess this is the key, but I don’t know how to get around this:

```auto

on(press)
 {
 voip.play();
 clearInterval(voip.myTimer);
  
 
 /* Sound stuff */
 voip.mySound.stop("testSound");
 voip.mySound.start(pauseTime/1000);
 }

```

What do you think? (I can provide you with the files if you like)

Rick
