Problem pausing timeling

I’m using this function

function wait(mc, n) {
mc.stop();
var myInterval = setInterval(function () {
mc.play();
clearInterval(myInterval);
}, 3 * 1000);
}
_root.wait(this, n)

To delay events along my timeline. That code works fine. My problem is that is that I also want the user to be able to pause the movie at any time. However, if the pause button I’m using is pressed by the user while the timeline is delayed using this function it starts playing again after the interval even if the pause button is still pressed. How can I override this wiat function with a pause button?

clear the interval before you set it and this should solve it :wink:

Prophet.

I’m afraid I’m an actionscript beginner. How and where exactly do I put the clearInterval?

Mark

function wait(mc, n) {
     mc.stop()
     clearInterval(myInterval)
     var myInterval = setInterval(function () {
         mc.play()
         clearInterval(myInterval)
     }, 3000)
  }
 _root.wait(this, n)

note i just changed your interval time to take up less characters… apologies if that annoys u but meh - personal preference :wink: same thing goes for the semi-colons ; :slight_smile:

Prophet.

Thanks for your help.

Mark

no prob :slight_smile:

Prophet.