# Play / Pause button - really need help!

**URL:** <https://forum.kirupa.com/t/play-pause-button-really-need-help/248449>\
**Category:** flash\
**Created:** [January 8, 2008, 10:02am UTC](https://forum.kirupa.com/t/play-pause-button-really-need-help/248449 "2008-01-08T10:02:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyeness](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@tyeness](https://forum.kirupa.com/u/tyeness)\
**Post date:** [January 8, 2008, 10:02am UTC](https://forum.kirupa.com/t/play-pause-button-really-need-help/248449/1 "2008-01-08T10:02:38Z")

</div>

I’m trying to create a little 10 image slideshow with a simple play/pause button.

The images fade in and out with a tween, and are paused for a few seconds between fades using the following code:

```auto
stop();

var nInterval = setInterval(Play, 3000);

function Play() {
clearInterval(nInterval);
gotoAndPlay(_currentframe+1);
}

```

I’m trying to add a play/pause button as well as a coupe of skip buttons, but I’m having real trouble stopping the main timeline, I’ve tried a few different methods revolving around

```auto
on(release){
_root.stop();
this.nextFrame();
}

```

(this.nextFrame(); is used as my play/pause buttons are on frames 1 and 2 of a 2 frame movie clip on the main timeline, used to show different button states)

It’s since struck me that when I stop the timeline with the button it probably sets a new interval and then plays again after 3 seconds?

My question is - How do I get round this? Alternatively if someone can point out another method to both pause my images for a few seconds and stop everything all together then I’m open to suggestions.

Thanks in advance!  
Matthew
