# Wait for a clip to finish playing

**URL:** <https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595>\
**Category:** flash\
**Created:** [February 15, 2003, 4:08am UTC](https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595 "2003-02-15T04:08:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![barzalou1](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@barzalou1](https://forum.kirupa.com/u/barzalou1)\
**Post date:** [February 15, 2003, 4:08am UTC](https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595/1 "2003-02-15T04:08:25Z")

</div>

Hi,

I need to understand how to control a sequence of events inside a function. What’s happening is that as I call different actions to be performed, it seems that when I enable a movie clip and then call for a second movie clip to do it’s thing, the second clip starts before the first one ends. How can I control the beginning of the second movie clip only when the first has finished performing it’s own?

Thank you

Barzalou:-\

---

<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:** [February 15, 2003, 4:27am UTC](https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595/2 "2003-02-15T04:27:57Z")

</div>

```auto
if (instance._currentframe == instance._totalframes) {
	instance.play()
} else {
	instance.stop()
}

```

replace **instance** with the appropriated instance name of the movie clips =)

---

<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:** [February 15, 2003, 4:30am UTC](https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595/3 "2003-02-15T04:30:59Z")

</div>

Thanx a lot (what a fast response!!!)🙂

---

<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:** [February 15, 2003, 4:35am UTC](https://forum.kirupa.com/t/wait-for-a-clip-to-finish-playing/13595/4 "2003-02-15T04:35:44Z")

</div>

no problem 🙂

and that’s not fast. it’s just the average here at [kirupa.com](http://kirupa.com) 😉
