Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
I didn't follow jasonmac's link on my phone, so not sure if this is redundant, but look at the StateMachine utility. There's a writup on the front page about it at the moment.-=Cliff>
{ public static const CANCEL_EFFECT:String = 'EffectSaveConfirmAsyncCommand.cancelEffect'; public static const SAVE_EFFECT:String = 'EffectSaveConfirmAsyncCommand.saveEffect'; public static const LOAD_EFFECT:String = 'EffectSaveConfirmAsyncCommand.loadEffect'; override public function execute ( note:INotification ) : void { var confirmPopUpMediator:ConfirmPopUpMediator = PopUpManager.openPopUpWindow(ConfirmPopUp,ConfirmPopUpMediator) as ConfirmPopUpMediator; confirmPopUpMediator.confirmPopUp.type = ConfirmPopUp.CANCELNOYES; confirmPopUpMediator.confirmPopUp.title = 'SAVE EFFECT'; confirmPopUpMediator.confirmPopUp.message = "Current effect has been changed. Do you want to save the changes?"; confirmPopUpMediator.confirmPopUp.closeHandler = closeHandler; } private function closeHandler(event:EventWithParameter):void { if (event.data == ConfirmPopUp.YES) { sendNotification(SAVE_EFFECT); } else if (event.data == ConfirmPopUp.CANCEL) { sendNotification(CANCEL_EFFECT); } else { sendNotification(LOAD_EFFECT); } // commandComplete(); this gives error if not commented } }