# setChildIndex not working

**URL:** https://forum.kirupa.com/t/setchildindex-not-working/312455
**Category:** Uncategorized
**Created:** [August 3, 2010, 8:48pm UTC](https://forum.kirupa.com/t/setchildindex-not-working/312455 "2010-08-03T20:48:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jermbo](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@jermbo](https://forum.kirupa.com/u/jermbo)
#### Post date: [August 3, 2010, 8:48pm UTC](https://forum.kirupa.com/t/setchildindex-not-working/312455/1 "2010-08-03T20:48:18Z")

</div>

So i have done a couple days worth of research and nothing I find is working.  
Maybe I am doing this wrong, i dont know. What I am trying to do is dynamically place movie clips into a container called container. when I roll over the movie clip I need it to show on top… right now its either not showing up on top or i get an Error #2006… out of bounds… Below is my AS3 code that i created to do what I want… so far everything is working except the rollover effect…  
can some one please help me fix it or point me to some reading material that would better explain what I am trying to do… thank you in advance…

```php

import caurina.transitions.*;
var imgHolder:MovieClip;
for (var i:int = 0; i < 6; i++){
    imgHolder = new imageHolder();
    imgHolder.x = (imgHolder.width + 3) * i;
    imgHolder.y = (container.height / 2);
    imgHolder.addEventListener(MouseEvent.ROLL_OVER, getBigger);
    imgHolder.addEventListener(MouseEvent.ROLL_OUT, getNormal);
    if(i == 0 || i == 2 || i == 4 || i == 6){
        imgHolder.alpha = 1;
    }else{
        imgHolder.alpha = .5;
    }
    container.addChild(imgHolder);
}

function getBigger(evt:MouseEvent):void{
    container.setChildIndex(evt.target as MovieClip, container.numChildren - 1)
    Tweener.addTween(evt.target, {scaleX:1.5, scaleY:1.5, time:1, transition:"easeOutExpo"});
}

function getNormal(evt:MouseEvent):void{
    Tweener.addTween(evt.target, {scaleX:1, scaleY:1, time:1, transition:"easeOutExpo"});
}

```
