# Help with removeMovieClip()

**URL:** <https://forum.kirupa.com/t/help-with-removemovieclip/4861>\
**Category:** flash\
**Created:** [August 23, 2002, 1:39am UTC](https://forum.kirupa.com/t/help-with-removemovieclip/4861 "2002-08-23T01:39:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![catherine878](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@catherine878](https://forum.kirupa.com/u/catherine878)\
**Post date:** [August 23, 2002, 1:39am UTC](https://forum.kirupa.com/t/help-with-removemovieclip/4861/1 "2002-08-23T01:39:57Z")

</div>

In Flash MX.

Hi everyone,

I am almost finished with my UrbanPlan project, which allows users to drag different building structures onto a map and print the design, but I am experiencing a major problem with the Clear All button that is to remove all duplicated MCs. This is the last step I need for my project. Please help! I have attached the fla file below.

In my fla file, I have a MC called ¡°component library¡± which contains 2 other MCs, namely ¡°office¡± and ¡°residential¡±. For example, in ¡°office¡± MC, there are two types of office buildings, lowrise and midrise. I made graphic symbols for lowrise and midrise, and set the Linkage Property on them. For example, I gave the symbol ¡°lowrise¡± a linkage identifier: lowrise1a¡±. Then I dragged the ¡°lowrise¡± symbols onto the ¡°office¡± MC, and convert it to a MovieClips with an instance name ¡°original-lowrise1a¡±. Then I went into the ¡°original-lowrise1a¡± MC, and defined the following frame action:

this.xHome = this.\_x;  
this.yHome = this.\_y;

this.onPress = startDrag;  
this.onRelease = this.onReleaseOutside=function () {  
stopDrag();  
if (this.\_name == “original-lowrise1a”)  
{  
\_root.d++;  
var myDupe = \_parent.attachMovie(“lowrise1a”, “lowrise1a”+\_root.d, \_root.d);  
myDupe.\_x = this.\_x;  
myDupe.\_y = this.\_y;  
this.\_x = this.xHome;  
this.\_y = this.yHome;  
}  
};

So far, this is all working just fine. The pieces are duplicated and draggable. However, I also want a ¡°Clear All¡± button that removes all building structures from the map, and here is where I have a major problem. On the button, I tried the following action:

on (release) {  
for (var i = 1; i\<=\_root.d; i++) {  
\_root[“lowrise1a”+i].removeMovieClip();  
\_root[“midrise”+i].removeMovieClip();  
}  
}

It¡¯s not doing anything. I suspect it¡¯s probably because the ¡°original-lowrise1a¡± MC is several levels down from the main scene, and the ¡°Clear All¡± button need to address the correct MC in order to delete duplicated MCs. I have no idea how to achieve this. Namely, I want to go through each MC (original-lowrise1a, original-midrise, etc) and remove all subsequent MCs generated by them. Can someone please help? Thank you!!

---

<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:** [August 23, 2002, 4:26am UTC](https://forum.kirupa.com/t/help-with-removemovieclip/4861/2 "2002-08-23T04:26:56Z")

</div>

I can’t see the FLA right now, because I’m at work, but if you let me know one thing I think I can help.

What is the OOP address of the movie clip that contains all the building movie clips.

\_root.“what is in here?”.building

---

<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:** [August 23, 2002, 4:28am UTC](https://forum.kirupa.com/t/help-with-removemovieclip/4861/3 "2002-08-23T04:28:45Z")

</div>

ok… I reread your post and I think I’m not being clear.

I see you have a couple of movie clips that contain movies. I need the paths to EACH container movie… each movie clip that contains buildings that need to be gotten rid of.

---

<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:** [August 23, 2002, 5:37pm UTC](https://forum.kirupa.com/t/help-with-removemovieclip/4861/4 "2002-08-23T17:37:11Z")

</div>

I think i am having problems with the same issue: I don’t know how to find out the paths about these nested movieclips.
