Flex: Sending parameters to Alert closeHandler

后端 未结 4 2126
天涯浪人
天涯浪人 2020-12-19 03:37

Is it possible to send parameters to a closeHandler Alert function? The fisrt parameter the function gets is the CloseEvent, but how to send another one?

<         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 03:58

    I usually use an anonymous function to wrap a function call with parameters:

    Alert.show("Are you sure?", Alert.YES | Alert.CANCEL, null, function(event:CloseEvent):void{doSomething(event.detail, param1, param2);}, null, Alert.CANCEL)
    

提交回复
热议问题