在click的处理程序上获取button / movieclip的实例

时间:2011-11-25 14:21:14

标签: flash actionscript-3 actionscript

以前在AS2.0中发生如下:

my_Mc.onPress  = function()
{
   trace( this) 
}

//output : 
[my_Mc Movieclip]

然而在AS3.0中,我想知道如何实现这个

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 ???? 
}

感谢。

1 个答案:

答案 0 :(得分:2)