addEventListener不工作flashbuilder 4.5

时间:2011-10-26 10:59:33

标签: flex actionscript flash-builder

我正在做这本书的所有内容(我认为),我已多次回顾这个问题,但我似乎无法解决这个问题。 creationCompleteHandler函数是b

protected function creationCompleteHandler(event:FlexEvent):void
{
    btnRequest.addEventListener(MouseEvent.CLICK, readData);
}

protected function readData():void 
{
    Alert.show("check check");
}

1 个答案:

答案 0 :(得分:3)

将事件作为参数添加到侦听器:

protected function readData(event:MouseEvent):void 
{
    Alert.show("check check");
}

或更好地编写按钮单击侦听器并从中调用readData()