How can I show an confirmation message in Actionscript 3?

actionscript-3, air, apache-flex

Solution

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

Then create an `alertEventHandler` with the following code:

function alertEventHandler(event:CloseEvent):void {
    if(event.detail == Alert.YES) {
        // pressed yes.
    }
}

Or check out a custom Dialog class: http://fatal-exception.co.uk/blog/?p=69

Problem

How can I show an confirmation message in Actionscript 3 ? I use Adobe Flex 3 and as3 for Air application

Original source