# Delaying an gotoAndPlay action

**URL:** https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943
**Category:** Uncategorized
**Created:** [September 2, 2003, 9:28am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943 "2003-09-02T09:28:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ahaab](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@ahaab](https://forum.kirupa.com/u/ahaab)
#### Post date: [September 2, 2003, 9:28am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943/1 "2003-09-02T09:28:19Z")

</div>

hello everybody… thanks for edvices posted.

this is what i need to learn today:  
i have this movie clip that i want to keep playing from time to time  
but because it is shot keeps flashing.  
how can one delay the loop.

greetings from Portugal…Ahaab:)

---

<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: [September 2, 2003, 9:57am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943/2 "2003-09-02T09:57:39Z")

</div>

Hi, I don’t fully understand your question, do you want the clip to pause before it plays or to play then pause before it loops round again

---

<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: [September 2, 2003, 9:57am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943/3 "2003-09-02T09:57:40Z")

</div>

hi ahaab,  
try searching for your post, there are a lot of similar posts about time delay…

this post it may help?

Check out this post.  
[http://www.kirupaforum.com/forums/s...7933#post267933](http://www.kirupaforum.com/forums/s...7933#post267933)

oohps…you got in there before me m\_andrews…hate it when that happens 😉

---

<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: [September 2, 2003, 10:03am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943/4 "2003-09-02T10:03:11Z")

</div>

Hi,

You can either add some extra frames at the end of you animation  
or you could set an interval and call the animation every so often.  
Something like:  
in the main timeline:

```php

interval = function(){
 var timeToWait= random(6);
 this.lapseId = setInterval("callAnimation", interval);
}
callAnimation = function(){
 myAnimation.gotoAndPlay(2);
}
this.interval();

```

And in the last frame of your animation:

```php

 clearInterval(this._parent.lapseId);
 this._parent.interval();

```

this way it will happen every so often at random intervals

SHO

---

<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: [September 2, 2003, 10:11am UTC](https://forum.kirupa.com/t/delaying-an-gotoandplay-action/29943/5 "2003-09-02T10:11:45Z")

</div>

i´m kind of sleepy and the frames solution escaped mi mind.  
i will apply it i thank the php solution, and try to use it in future, because i am too green on as, and some times staring at code is like staring at a dinossaure.

greetings …Ahaab
