# Pause and play function

**URL:** <https://forum.kirupa.com/t/pause-and-play-function/165017>\
**Category:** Uncategorized\
**Created:** [October 6, 2005, 8:23pm UTC](https://forum.kirupa.com/t/pause-and-play-function/165017 "2005-10-06T20:23:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattyshack](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mattyshack/32/1559_2.png) [@mattyshack](https://forum.kirupa.com/u/mattyshack)\
**Post date:** [October 6, 2005, 8:23pm UTC](https://forum.kirupa.com/t/pause-and-play-function/165017/1 "2005-10-06T20:23:50Z")

</div>

I am using a stop(); gotoAndPlay with setInterval on a series of swf files that are loaded into a container movie. There is a bug in doing this, in which when one of the swfs is loaded into the container and you click on a link to load a different swf before the current swf has gotten to the frame in which you reach this function, its stops the function and nothing pauses/plays anymore.

```auto
stop(); //the last frame you want the movie played

goAgain=function(){
gotoAndPlay('62'); // "x" is the next frame will be playing
clearInterval (playAgain);
}

playAgain=setInterval(goAgain, 5000); 

```
