# Remove All movieclips at once?

**URL:** <https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376>\
**Category:** programming\
**Created:** [May 27, 2008, 3:02am UTC](https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376 "2008-05-27T03:02:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amymation](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Amymation](https://forum.kirupa.com/u/Amymation)\
**Post date:** [May 27, 2008, 3:02am UTC](https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376/1 "2008-05-27T03:02:11Z")

</div>

I have another problem.  
In my game the player goes to gameover when it hits an enemy but the thing is that the enemies are still floating around on the game over screen! (There’s loads of enemies)  
I’ve tried the:  
removeMovieClip(“enemy”);  
action but it only removes two of them away.

Please help!

---

<div class="post-metadata">

**Author:** ![cooldude88](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@cooldude88](https://forum.kirupa.com/u/cooldude88)\
**Post date:** [May 27, 2008, 3:13am UTC](https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376/2 "2008-05-27T03:13:40Z")

</div>

well if your using duplicateMovieClip you could proboly just do something like  
if(loss==true){  
unloadMovie([‘badguy’+i]);  
}  
hope that works for ya if not let me know ill c what else i can think of.

---

<div class="post-metadata">

**Author:** ![Amymation](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@Amymation](https://forum.kirupa.com/u/Amymation)\
**Post date:** [May 27, 2008, 3:44am UTC](https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376/3 "2008-05-27T03:44:00Z")

</div>

Still doesn’t work ☹

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [May 27, 2008, 4:35am UTC](https://forum.kirupa.com/t/remove-all-movieclips-at-once/261376/4 "2008-05-27T04:35:19Z")

</div>

```auto
for (var i in myMovieClip) {
if(typeof(myMovieClip*) == "movieclip") {
myMovieClip*.swapDepths(myMovieClip._parent.getNextHighestDepth);
myMovieClip*.removeMovieClip();
}
}

```
