# setChildIndex --\> event.currentTarget (simple problem)

**URL:** <https://forum.kirupa.com/t/setchildindex-event-currenttarget-simple-problem/246318>\
**Category:** flash\
**Created:** [December 10, 2007, 2:31am UTC](https://forum.kirupa.com/t/setchildindex-event-currenttarget-simple-problem/246318 "2007-12-10T02:31:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skofo](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@Skofo](https://forum.kirupa.com/u/Skofo)\
**Post date:** [December 10, 2007, 2:31am UTC](https://forum.kirupa.com/t/setchildindex-event-currenttarget-simple-problem/246318/1 "2007-12-10T02:31:25Z")

</div>

Hi guys,

I have a problem. I’m still learning the basics of Flash, so this will seem pretty trivial to most of you, but I would really appreciate some help with this.

I tried using setChildIndex on event.currentTarget, but it doesn’t seem to work. I can’t decipher the error that pops up.

_This is the entire code:_

```auto
            for(var i:int=0;i<10;i++){ //Sphere worm
                var Circle:BlueSphere = new BlueSphere();
                Circle.x = 40*i+50;
                Circle.y = 200;
                Circle.scaleX = i*.4;
                Circle.scaleY = i*.4;
                Circle.buttonMode = true;
                Circle.pos = i;
                Circle.addEventListener(MouseEvent.CLICK,clickCircle);
                function clickCircle(event:MouseEvent){
                    event.currentTarget.y += 10;
                    setChildIndex(event.currentTarget,0);
                    trace("You clicked " + event.currentTarget + " " + event.currentTarget.pos + "!");
                }
                addChild(Circle);
            }

```

_This is the error::_

```auto
1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.

```

_It refers to this:_

```auto
setChildIndex(event.currentTarget,0);

```

Thanks for reading this. Any help would be greatly appreciated!
