import mx.events.CloseEvent;
import mx.controls.Alert;
[Embed(source="a.png")]
private var questionIcon:Class;
private function simpleAlert():void{
Alert.show("An Alert dialog with close event handler",
"Alert Event Handler", (Alert.OK | Alert.CANCEL),
null, alertCloseHandler);
}
private function alertCloseHandler(event:CloseEvent):void
{
if (event.detail == Alert.OK)
{
Alert.show("You clicked " + Alert.okLabel, "Close Event Handler");
}
else
{
Alert.show("You clicked " + Alert.cancelLabel, "Close Event Handler");
}
}