addEventListener和dispatchEvent的奇怪问题
我往a按钮和b按钮addEventListener不同的单击事件。
a的单击事件里派发b按钮的单击事件。
a按钮=idSubmit,b按钮=idButton
也就是
public function creationComplete(_event:FlexEvent):void{ /* idComboBox.dataProvider = [{label:"kimi",data:"1"},{label:"kimi2",data:"2"},{label:"kimi3",data:"3"}]; idComboBox.selectedIndex = -1; Alert.show(idComboBox.text,"",1); */ IEventDispatcher(idSubmit).addEventListener(MouseEvent.CLICK, showMessage1); IEventDispatcher(idButton).addEventListener(MouseEvent.CLICK, showMessage2); } public function showMessage1(_event:MouseEvent):void{ idButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } public function showMessage2(_event:MouseEvent):void{ trace("213213"); }