# Dynamically remove any attached mc's if there are any?

**URL:** <https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639>\
**Category:** Uncategorized\
**Created:** [March 7, 2004, 8:30pm UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639 "2004-03-07T20:30:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artom](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Artom](https://forum.kirupa.com/u/Artom)\
**Post date:** [March 7, 2004, 8:30pm UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/1 "2004-03-07T20:30:45Z")

</div>

Guys,

how would i go about writing a function that looks at an mc(empty mc) and deletes any attached movie clips (if there are any).

Thanks in advance.

---

<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 6, 2004, 8:20am UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/2 "2004-04-06T08:20:25Z")

</div>

Hah, I know that 😉  
but I tried with both codes and I couldn’t let it work.

```auto

MovieClip.prototype.removeMovieClips = function() {
	for (var objs in this) {
		if (typeof (this[objs]) == "movieclip") {
			this[objs].removeMovieClip();
		}
	}
};
MovieClip.prototype.disable = function() {
	trace('disable');
	for (var objs in this) {
		if (typeof (this[objs]) == "movieclip") {
			this[objs].enabled = false();
		}
	}
};

menu.removeMovieClips()

```

this is what I tried

---

<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 6, 2004, 9:03am UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/3 "2004-04-06T09:03:23Z")

</div>

```auto
MovieClip.prototype.disable = function() {
        trace('disable');
        for (var objs in this) {
                if (typeof (this[objs]) == "movieclip") {
                        this[objs].enabled = false;
                }
        }
}; 
menu.disable();

```

?

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 6, 2004, 9:24am UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/4 "2004-04-06T09:24:14Z")

</div>

ach zo nu zie ik mijn fout :d // now I see my mistake  
elabled = [false] in stead of [false()]

THX SCOTTY :d

---

<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 6, 2004, 9:37am UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/5 "2004-04-06T09:37:07Z")

</div>

[dutch]geen probleem;) [/dutch]

---

<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 6, 2004, 11:25am UTC](https://forum.kirupa.com/t/dynamically-remove-any-attached-mcs-if-there-are-any/103639/6 "2004-04-06T11:25:01Z")

</div>

Here I am again :s  
I just have some problems with placing and targeting the protoypes.

This is what I’d like to do with this disable prototype: a menu which is dynamic and loads new data (is already finished), I’d like to add another prototype to it, enable and disable all buttons so you can’t click them whil there’s loading new data which would mess up the animation.

But I tried to solve it an other way, which works fine so, no further questions 😛  
Could you just say where to place the prototypes? in the main movie or in the movie itself, where all the buttons should be disabled?

THX A LOT
