import mx.events.CloseEvent;
import mx.controls.Alert;
[Embed(source="a.png")]
private var iconclass:Class
private function createAlert():void
{
mx.controls.Alert.buttonHeight = 20;
mx.controls.Alert.buttonWidth = 150;
mx.controls.Alert.show("This is an alert", "title of the alert", 1|2|8, this, alertClosed, iconclass);
}
private function alertClosed(event:CloseEvent):void
{
trace(" alert closed ");
if(event.detail == Alert.YES)
{
trace(" user clicked yes ");
}
else if(event.detail == Alert.CANCEL)
{
trace(" user clicked cancle ");
}
else
{
trace(" user clicked no ");
}
}