# setChildIndex problems

**URL:** <https://forum.kirupa.com/t/setchildindex-problems/289376>\
**Category:** flash\
**Created:** [May 29, 2009, 4:32pm UTC](https://forum.kirupa.com/t/setchildindex-problems/289376 "2009-05-29T16:32:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)\
**Post date:** [May 29, 2009, 4:32pm UTC](https://forum.kirupa.com/t/setchildindex-problems/289376/1 "2009-05-29T16:32:59Z")

</div>

Hey all,  
I have a series of buttons that are calling in dynamic movie clips.  
Here is a sample of 1 of those buttons

//Puts the movie clip on the stage  
var resrV:scene1 = new scene1();  
stage.addChild(resrV);  
resrV.x = 41;  
resrV.y = 309;

//reservation function  
function reservations(event:MouseEvent):void  
{  
resrV.gotoAndPlay(2);  
stage.setChildIndex(group,resrV + 1);  
}

//sets moustEvent  
reservationsBtn\_mc.addEventListener(MouseEvent.MOUSE\_UP, reservations);

What I want to do is, each time the button is clicked, it brings that movie clip to the front of the pile of movie clips that I loaded in dynamically.

I thought it was going to be done through setChildIndex, and maybe still is, but it doesn’t seem to be working for me. The setchildIndex look as though it’s only for 2 childs to swamp with each other, but all I want to do is bring one child to the front and play over top of the child that was there.

I hop this make sense.  
Thanks for your help in advance!
