It used to happen in AS2.0 as follows :
my_Mc.onPress = function()
{
trace( this)
}
//output :
[my_Mc Movieclip]
However in AS3.0, i wonder how to achieve this
my_Mc.addEventListener( MouseEvent.CLICK, click) ;
function click(e:Event)
{
trace( this ) ; // output is the class instance, where the handler is being used
// How to get the instance of my_Mc here ????
}
thanks.
What you’re looking for is the
e.currentTargetproperty.http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/Event.html#currentTarget