# Major problem - Help - stopping multiple movieclips

**URL:** https://forum.kirupa.com/t/major-problem-help-stopping-multiple-movieclips/20483
**Category:** Uncategorized
**Created:** [May 9, 2003, 2:36am UTC](https://forum.kirupa.com/t/major-problem-help-stopping-multiple-movieclips/20483 "2003-05-09T02:36:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![liquivision](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@liquivision](https://forum.kirupa.com/u/liquivision)
#### Post date: [May 9, 2003, 2:36am UTC](https://forum.kirupa.com/t/major-problem-help-stopping-multiple-movieclips/20483/1 "2003-05-09T02:36:03Z")

</div>

Hello Everyone,

I have a problem stopping multiple clips.

I have created a presentation using flash and I have many movie clips which have sub movie clips inside of them.

Ok lets look at one movie clip in detail. Inside one \_root movie there are multiple sub movies; each with a different movieclip labels (each movie clip is named with unique labels ie. north, south, east, west, and …).

What I need to do is be able to STOP all these sub movie clips with one stop, and in turn PLAY these same movie clip with a second action.

The only way I know how to stop all these sub movie clips is to target each and every one individually.

This is the code I used on the button to stop:

// \_root movie clip label is myHoldermovieclip  
// sub clips labeled north, south, east, west  
//button is located on \_root timeline

on (release);  
myHoldermovieclip.north.stop();  
myHoldermovieclip.south.stop();  
myHoldermovieclip.east.stop();  
myHoldermovieclip.weat.stop();

This is the code I used on the button to play:

on (release);  
myHoldermovieclip.north.play();  
myHoldermovieclip.south.play();  
myHoldermovieclip.east.play();  
myHoldermovieclip.weat.play();

As you can see this is very lengthy, and I need to repeat this type of action to a multitude of \_root movie clips (approx. 50 clips).

Is there any way to code the \_root movie clip so that all of its sub movie clip will stop together without targeting each?

Help!!

Thanks 🙂

---

<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: [May 9, 2003, 4:48am UTC](https://forum.kirupa.com/t/major-problem-help-stopping-multiple-movieclips/20483/2 "2003-05-09T04:48:18Z")

</div>

you could name them sequentialy, mc1, mc2,…, mc2 and use a for loop:

```auto

for(i=1;i<=n;i++){
 myHoldermovieclip["clip"+i].stop();
}

```

or you can put them all in an array, and apply the same logic, or use a for-in loop, like in the fla

---

<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: [May 9, 2003, 2:21pm UTC](https://forum.kirupa.com/t/major-problem-help-stopping-multiple-movieclips/20483/3 "2003-05-09T14:21:19Z")

</div>

Hi nunomira ,

Brilliant idea, the array works great!!

// all I did was substitute my \_root movie clip labels into the place of mc in the code below  
for (mc in main) {  
if (typeof (main[mc]) == “movieclip”) {  
main[mc].stop();  
}  
}

However this has generated two small problems.

First - When I use the array to stop the sub movies the \_root movie clip continues to play.  
Second - Not all sub movie clips stop. [Not to sure but it could have something to do with the placement of all the sub movie clips. Each sub mc is positioned approx. ten frames apart.]

Any suggestions??

Thanks
