如何在Actionscript 3中显示确认信息?

4

如何在Actionscript 3中显示确认消息?

我使用Adobe Flex 3和as3来开发Air应用程序。

2个回答

5
Alert.show("Are you sure?", "Title",
    mx.controls.Alert.YES | mx.controls.Alert.NO, this, alertEventHandler);

然后使用以下代码创建一个alertEventHandler
function alertEventHandler(event:CloseEvent):void {
    if(event.detail == Alert.YES) {
        // pressed yes.
    }
}

或者查看自定义对话框类:http://fatal-exception.co.uk/blog/?p=69


我得到了这个错误: 1119:通过具有静态类型类的引用访问可能未定义的属性No。 - Waseem
请查看以下链接:http://livedocs.adobe.com/flex/3/langref/mx/controls/Alert.html。是的,没错。对于打字错误,我很抱歉。 - Pindatjuh

0
你可以使用 Alert 类来实现这个功能。
Alert.show(...);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接