我有一个 group g1 addElement MyComponent comp1 和一个 UIComponent c1 add child g1 和一个自定义事件 customEvent1 意味着:
c1.addChild(g1.addElement(comp1))
所以 comp1.parent 为空
这是一些代码
我的组件:
private function mouseUpFunction(e:MouseEvent):void {
//e.stopPropagation();
var event:MouseChangeEvent = new MouseChangeEvent(MouseChangeEvent.Mouse_Up_Objective);
dispatchEvent(event);
}
private function mouseDownFunction(e:MouseEvent):void{
//e.stopPropagation();
var event:MouseChangeEvent = new MouseChangeEvent(MouseChangeEvent.Mouse_Down_Objective);
dispatchEvent(event);
}
主应用:
stage.addEventListener(MouseChangeEvent.Mouse_Down_Objective, mouseDownHandler);
stage.addEventListener(MouseChangeEvent.Mouse_Up_Objective, mouseUpHandler);
问题是 comp1 调度事件,但它永远不会捕获!:(