0)
dialog.title = title;
dialog.message = message;
if (closeListener != null)
dialog.addEventListener(CloseEvent.CLOSE, closeListener);
dialog.invoker = invokerComponent;
//Dispatch the event for get clear background
Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));
PopUpManager.centerPopUp(dialog);
}
private function creationCompleteHandler() : void {
var focusTimer: Timer = new Timer(500, 1);
focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
focusTimer.start();
}
private function okButtonHandler() : void {
dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,OK));
removePopUp();
}
private function cancelButtonHandler() : void {
dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,CANCEL));
removePopUp();
}
private function removePopUp(): void
{
//Dispatch the event for remove clear background
Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));
PopUpManager.removePopUp(this);
if (invoker != null){
callLater(setUIComponentFocus);
}
}
private function setUIComponentFocus(): void
{
invoker.setFocus();
}
private function moveFocus(e: TimerEvent): void
{
if (AccessibilityTools.isAccessibilityActive()) {
messageBox.setFocus();
} else {
messageBox.editable = false;
cancelBtn.setFocus();
}
}
]]>