# Best way to pause multiple movie clips

**URL:** https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518
**Category:** flash
**Created:** [April 17, 2003, 1:55pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518 "2003-04-17T13:55:36Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [April 17, 2003, 1:55pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/1 "2003-04-17T13:55:36Z")

</div>

Okay, I have a pause button with a stop action on it. I just recently found out how to target movie clips in order to pause them as well, but I am wondering the best way to assign the action pause all movie clips used in the scene at once.  
Do I have to list each one seperately or can I target them all in the same action?

Example:  
\<hr\>  
on (release) {  
\_root.movieclip#1name.stop ();  
}  
on (release) {  
\_root.movieclip#2name.stop ();  
}  
\<hr\>  
OR can I do it like this  
\<hr\>  
on (release) {  
\_root.movieclip#1name,movieclip#2name,movieclip#3name.stop ();  
}  
\<hr\>

Thanks for any help  
:nerd:

---

<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: [April 17, 2003, 2:07pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/2 "2003-04-17T14:07:51Z")

</div>

put an and instead of the comas and make sure to put a space on both sides of it…like on(release) {  
+root.movieclip1.stop() and movieclip2.stop();  
}  
it SHOULD work

---

<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: [April 17, 2003, 2:31pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/3 "2003-04-17T14:31:59Z")

</div>

you could use a for in loop. 😉

```auto
on (release) {
for (var clips in _root) {
_root[clips].stop();
}
}

```

---

<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: [April 17, 2003, 3:20pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/4 "2003-04-17T15:20:42Z")

</div>

Okay thanx guys-  
My email wasn’t saying I had any replies so I went ahead and just tried it without checking here first. I ended up doing them  
all seperately like my first example.

I have to do it in several places though, so I will probably try the example you gave, crazygamer.

Kax, I don’t really understand the for in loop thing…are you saying that I could just use this one piece of code and it would  
take care of stopping all the clips without naming them all?

:q:

---

<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: [April 17, 2003, 3:25pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/5 "2003-04-17T15:25:47Z")

</div>

yep… i just found out this for and while stuff and its really neat… with the for… in statment it will contol all the movie clips in the place you have defined as in… and that all… so its really good… anyway there was a flash beginer trying to sound like an expert… did it work?? doubt it… =p anyway… maybe kax can explain it better…

---

<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: [April 17, 2003, 3:27pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/6 "2003-04-17T15:27:55Z")

</div>

jillymo i just notice i put a plus in the code…WHOOPS…don’t add that…that’s just a type!

---

<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: [April 17, 2003, 3:30pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/7 "2003-04-17T15:30:13Z")

</div>

thank aussie I am an AS beginner too, so I pretty much got what you were saying. Except for this part:  
\<hr\>  
you have defined as in  
\<hr\>  
what do you mean when you say you have to define them as in?

---

<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: [April 17, 2003, 3:38pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/8 "2003-04-17T15:38:56Z")

</div>

opps other way round should be “in the place you have deffined in as” which mean that… if u take an example of the code

```auto

for(clips in _root){
     _root.[clips].stop()
}

```

if you look the script you see that the “in” is set as the \_root which is the main timeline so at the moment the script will seach the maintime line for any movie clips regardless of their names. Then when it has done that the script then regonises them by calling them clips and then tells clips to stop… so what you rename clips to makes no difference as long as its the same in the for statment and infront of the stop() and the only inportant thing is where u have to tell the script to search for movie clips.

Well i read that all out of the flash mx bible for the first time only ½hr ago… so it might not make much sense… so… anyway… hope i helped…

---

<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: [April 17, 2003, 3:39pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/9 "2003-04-17T15:39:37Z")

</div>

> _Originally posted by jillymo_  
> **are you saying that I could just use this one piece of code and it would take care of stopping all the clips without naming them all?**

yup… that’s what i said. 😉

[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary275.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary275.html)

---

<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: [April 17, 2003, 3:42pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/10 "2003-04-17T15:42:59Z")

</div>

or yeah u could read the explaination on the macromedia site which is defiantly better than mine… anyway… i tried atleast… lol…

//Scotty//

---

<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: [April 17, 2003, 3:54pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/11 "2003-04-17T15:54:17Z")

</div>

that’s what matters aussie, you tried. 😉  
and it wasn’t bad at all. =)

---

<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: [April 17, 2003, 3:56pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/12 "2003-04-17T15:56:50Z")

</div>

yeah… thanks… can just ask you one question and then i will leave this thread alone…

How long have you been using flash kax?? too get this good??

Anyway… glad i helped… even if it was a little bit…

//Scotty//

---

<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: [April 17, 2003, 3:59pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/13 "2003-04-17T15:59:27Z")

</div>

see my profile. i’ve been using flash since the day i registered here. 🙂

---

<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: [April 17, 2003, 4:07pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/14 "2003-04-17T16:07:57Z")

</div>

=)  
Thanks again guys…I get it!! :love:  
Aussie I think you did a great job explaining.

---

<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: [April 17, 2003, 4:09pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/15 "2003-04-17T16:09:20Z")

</div>

Thanks… glad we could help… and kax youve been using flash for a shorter time than me… your pretty good… anyway… i guess i should get back to increasing my flash skills… so… zya people…

//Scotty//

---

<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: [April 17, 2003, 4:21pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/16 "2003-04-17T16:21:12Z")

</div>

you’re welcome, jillymo. =)

and thanks, aussie. but there’s a lot of things still to learn. 😉

---

<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: [April 17, 2003, 6:02pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/17 "2003-04-17T18:02:33Z")

</div>

Hey Crazygamer this DOES work :bounce:  
Thank you!

\<hr\>  
put an and instead of the comas and make sure to put a space on both sides of it…like on(release) {  
+root.movieclip1.stop() and movieclip2.stop();  
}  
it SHOULD work  
\<hr\>

---

<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: [April 17, 2003, 6:03pm UTC](https://forum.kirupa.com/t/best-way-to-pause-multiple-movie-clips/18518/18 "2003-04-17T18:03:11Z")

</div>

without the (oops) plus sign of course 😉
