# Pause frame xseconds

**URL:** <https://forum.kirupa.com/t/pause-frame-xseconds/9429>\
**Category:** flash\
**Created:** [December 11, 2002, 6:56pm UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429 "2002-12-11T18:56:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melissa\_Anne](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Melissa\_Anne](https://forum.kirupa.com/u/Melissa_Anne)\
**Post date:** [December 11, 2002, 6:56pm UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429/1 "2002-12-11T18:56:33Z")

</div>

Hi,  
I need a script for a frame:

How do I pause a frame for 6 seconds and then continues to play ?.  
thx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2002, 7:19pm UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429/2 "2002-12-11T19:19:04Z")

</div>

the best way is to use the setInterval command. here is an example

```auto
function playclip(){
	_root.play();
	clearInterval(delay);
}
delay = setInterval(playclip,6000);
stop();

```

first we create a function with the play command and clearInterval command which I will explain later. The function is named playclip.

next we set a variable “delay” equal to our setInterval command.  
The set Interval command is:

setInterval(function to execute, time to delay in milliseconds);

it is actually a loop command that executes a command every so many milliseconds. however in the function there is a clearInterval command pointing to the delay variable, this will get rid of the setInterval command after the first time it executes.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 10:20pm UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429/3 "2003-01-28T22:20:03Z")

</div>

I tried using this script in a movie loaded into a blank clip of another movie.

The script fuctioned perfectly when the movie is run on its own, but when it is loaded into the other movie’s blank clip, it will cause all movies subsequently loaded into that blank clip to begin looping with the same pause time between loops.

The script at [http://www.kirupaforum.com/showthread.php?s=&threadid=8919&highlight=pause+script](http://www.kirupaforum.com/showthread.php?s=&threadid=8919&highlight=pause+script) does the same thing, but does not cause the “interference” on subsequent movies.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 10:52pm UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429/4 "2003-01-28T22:52:07Z")

</div>

it’s because you are targeting the root and telling that to play, take the \_root. off of the play command and see if that fixes your problems.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 29, 2003, 5:22am UTC](https://forum.kirupa.com/t/pause-frame-xseconds/9429/5 "2003-01-29T05:22:24Z")

</div>

That was the first thing I did, but it didn’t make a difference.
