# Removing movieclips

**URL:** <https://forum.kirupa.com/t/removing-movieclips/62649>\
**Category:** Uncategorized\
**Created:** [August 30, 2004, 7:22am UTC](https://forum.kirupa.com/t/removing-movieclips/62649 "2004-08-30T07:22:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boondogger](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@Boondogger](https://forum.kirupa.com/u/Boondogger)\
**Post date:** [August 30, 2004, 7:22am UTC](https://forum.kirupa.com/t/removing-movieclips/62649/1 "2004-08-30T07:22:09Z")

</div>

I’ve checked out a few tutorials on this subject but I’m evidently too dense to understand them. I’m using the following code to attach some movieclips containing invisible buttons:

for (v=0;v\<HighlightedHexes.length;v++)  
{  
HexStore [HighlightedHexes [v].HexNoId].attachMovie(“mytile&button”, “newtile&button”+v , depth++);  
}

Later on I need to remove these buttons/movieclips and place another lot of them somewhere else. What code do I use to remove them?

---

<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 30, 2004, 8:25am UTC](https://forum.kirupa.com/t/removing-movieclips/62649/2 "2004-08-30T08:25:25Z")

</div>

> [@Boondogger](#):
>
> I’ve checked out a few tutorials on this subject but I’m evidently too dense to understand them. I’m using the following code to attach some movieclips containing invisible buttons:
> 
> for (v=0;v\<HighlightedHexes.length;v++)  
> {  
> HexStore [HighlightedHexes [v].HexNoId].attachMovie(“mytile&button”, “newtile&button”+v , depth++);  
> }
> 
> Later on I need to remove these buttons/movieclips and place another lot of them somewhere else. What code do I use to remove them?

I think this should work  
for (v=0; v\<HighlightedHexes.length; v++) {  
HexStore[HighlightedHexes[v].HexNoId][“newtile&button”+v].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:** [August 30, 2004, 8:01pm UTC](https://forum.kirupa.com/t/removing-movieclips/62649/3 "2004-08-30T20:01:15Z")

</div>

Thanks stringy,

that works fine! You’re a star!

Boondogger
