# \[FMX\]Removing a MovieClip that is not Duplicated

**URL:** https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542
**Category:** flash
**Created:** [February 1, 2003, 2:15pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542 "2003-02-01T14:15:46Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [February 1, 2003, 2:15pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/1 "2003-02-01T14:15:46Z")

</div>

Hello,  
I’ve seem to have hit a snafu in a small animation I am creating for my next tutorial. What I have, is a movie clip that gets duplicated when the space bar is pressed. The movieclip has actions setup so that when the movieclip reaches a certain y value, it will remove itself via this.removeMovieClip()

The problem is, every movie clip that is duplicated does remove itself like it is supposed to. The exception is the original movie clip that I duplicate from. That movie clip seems to want to stay and cause problems (it is not removing itself because it isn’t duplicated via attachmovie or the duplicateMovieClip method).

I have included an attachment if it may help someone.

Thanks!  
Kirupa :bandit:

---

<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 1, 2003, 3:06pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/2 "2003-02-01T15:06:43Z")

</div>

kirupa… did you search first?

😉

[http://www.kirupaforum.com/showthread.php?s=&threadid=12937&highlight=removemovieclip](http://www.kirupaforum.com/showthread.php?s=&threadid=12937&highlight=removemovieclip)

---

<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 1, 2003, 4:04pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/3 "2003-02-01T16:04:28Z")

</div>

lol, yeah I actually did find that thread =) The problem is that any actions in the onEnterFrame of that movie clip continue executing, and that will eventually cause system resources to be wasted on that movie clip. Does setting the visibility to false prevent any actions from executing as well?

Thanks!  
Kirupa 😛

---

<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 1, 2003, 4:06pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/4 "2003-02-01T16:06:51Z")

</div>

removing the clip will also remove the onEnterFrame events associated with that clip (it should at least)… that is unless that event is being handled through some other object.

\_visible only affects the visual aspect of the clip on the screen. Scripts running in an invisible clip will continue to run even when a movieClip’s \_visible is set to false.

---

<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 1, 2003, 4:12pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/5 "2003-02-01T16:12:11Z")

</div>

Thanks =) I might try to find another way - if not, it’s fine the way it is.

Cheers!  
Kirupa :ub:

---

<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 1, 2003, 4:18pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/6 "2003-02-01T16:18:22Z")

</div>

I downloaded the fla… the problem youd be having is that your duplicated clip retains the same properties of all the bullets… that being moving up nd killing itself after y \< 0. If you remove the main bullet, you can no longer dupicate it. So thats something you really dont WANT to do, atleast not until you never want to shoot again.

If you dont like the fact that the original bullet is always there, you can use attachMovie instead. Event handling can be done on a second frame with a gotoAndPlay(1) within that bullet, or by having in that bullet another movieclip and use movieClip events on that to control its \_parent (which is the main bullet itself)

---

<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 1, 2003, 4:48pm UTC](https://forum.kirupa.com/t/fmx-removing-a-movieclip-that-is-not-duplicated/12542/7 "2003-02-01T16:48:57Z")

</div>

Hey senocular,  
Thanks! I found that if I set this ‘if’ statement before any action could execute:

```php
	if (this != _level0.bullet) {

```

It prevents the original movieclip, bullet, from doing anything.

Thanks!  
Kirupa :geek:
