# Instance Names

**URL:** <https://forum.kirupa.com/t/instance-names/240585>\
**Category:** flash\
**Created:** [October 4, 2007, 7:46am UTC](https://forum.kirupa.com/t/instance-names/240585 "2007-10-04T07:46:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fydus](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@Fydus](https://forum.kirupa.com/u/Fydus)\
**Post date:** [October 4, 2007, 7:46am UTC](https://forum.kirupa.com/t/instance-names/240585/1 "2007-10-04T07:46:20Z")

</div>

I want to use this test function to have certain objects brought to the front.  
I want all objects to be able to use this same function to be brought to the front but have a problem in determining which object evokes the function.

```auto
import flash.display.*;
import flash.events.*;
function Main() extends MovieClip
{
	t1.index = depth;
	addChildAt(t1,depth++);
	t1.addListener(MouseEvent.MOUSE_DOWN, test);
}

function test(event:MouseEvent):void
{
	setChildIndex(event.target, 3);
}

```

With the setChildIndex line I get this error…

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

Do I have to wrap “event.target” as an Object? Does AS3 allow wrapping? And if so, how?

Thanks
