# setChildIndex making duplicate movieclips?

**URL:** <https://forum.kirupa.com/t/setchildindex-making-duplicate-movieclips/318114>\
**Category:** flash\
**Created:** [January 11, 2011, 1:52am UTC](https://forum.kirupa.com/t/setchildindex-making-duplicate-movieclips/318114 "2011-01-11T01:52:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![acerbist](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@acerbist](https://forum.kirupa.com/u/acerbist)\
**Post date:** [January 11, 2011, 1:52am UTC](https://forum.kirupa.com/t/setchildindex-making-duplicate-movieclips/318114/1 "2011-01-11T01:52:50Z")

</div>

Thank you ahead of time to anyone who reads this.

I’m working on a flash site with a global navigation that has a drop down. I’m also loading in external swfs occasionally, and when I do, I need to bring the drop down to the top layer.

This is the code I’m using:

```auto
setChildIndex(music_mc,numChildren - 1);

```

Everytime I use that bit of code, it is bringing music\_mc to the top, which is great, but it also seems to be duplicating it. I tested this by also having the movieclip move 20 pixels each time I called it, and sure enough, I could see the other instances. I commented out this one line of code, and left in the movement, and the duplications were gone, so I’m pretty sure this is the culprit.

Has anyone seen this before? Is there a way to stop it from duplicating?

Thanks!!!
