import mx.controls.Alert;
import mx.events.CloseEvent;
private function showAlert(event:Event):void {
var alert:Alert = Alert.show("clicked","Important Message",Alert.OK | Alert.CANCEL,this,alertClickHandler);
}
private function alertClickHandler(event:CloseEvent):void {
var buttonType:String;
if(event.detail == Alert.OK) {
buttonType = "OK";
}
else {
buttonType = "Cancel";
}
textInput.text = buttonType;
}