# swapChild for MC on stage

**URL:** <https://forum.kirupa.com/t/swapchild-for-mc-on-stage/320150>\
**Category:** flash\
**Created:** [March 15, 2011, 12:16pm UTC](https://forum.kirupa.com/t/swapchild-for-mc-on-stage/320150 "2011-03-15T12:16:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarletclark](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@scarletclark](https://forum.kirupa.com/u/scarletclark)\
**Post date:** [March 15, 2011, 12:16pm UTC](https://forum.kirupa.com/t/swapchild-for-mc-on-stage/320150/1 "2011-03-15T12:16:12Z")

</div>

Hi,

I’m struggling with swapChild. I have a (very!) simple flash jigsaw, with my pieces on stage at runtime, rather than created dynamically. When picked up and moved, I want to bring each piece to the fore, so they are not moved behind any other piece or other item on the stage.

I can find lots of help about the new swapChild for mcs which are called to the stage with ActionScript, but I cannot figure out a way to apply this to mcs that are already on the stage. I don’t \*technically \*want to swap two children; I need to bring each to the highest depth when clicked on (ie within addEventListener:mouse event). This used to be simple in AS2. I appreciate swapChild is easier overall, but in this instance I just can’t get my head around it! No doubt it’ll be obvious when someone points it out to me!

Thanks for any help.
