0
我想要在movieclip(ChildClass)的視覺父級中獲取e.target的值。請參閱* ** * ** * ** *在下面的代碼。如何捕捉小孩的event.target?
public class ParentClass extends MovieClip
{
public function ParentClass()
{
addEventListener(ChildClass.SOMETHING_HAPPENED, somethingHappened)
}
public function somethingHappened(e:Event)
{
//**************************************************
//**************************************************
// WANT TO GET THE VALUE OF e.target (ie. instance of SimpleButton) OF CHILD CLASS
//****************************************************
//**************************************************
}
}
public class ChildClass extends MovieClip
{
public static const SOMETHING_HAPPENED:String = "someThingHappened" ;
public function ChildClass()
{
my_btn.addEventListener(MouseEvent.CLICK, my_btn_CLICK)
}
public function my_btn_CLICK(e:Event)
{
dispatchEvent(new Event(ChildClass.SOMETHING_HAPPENED));
}
}