Ok, I'm creating an app that has an "exit" button in all views, and when that button is clicked the only thing that I do is use "navigator.popToFirstView()", this works perfect, but I don't want people to exit right away, I want to have a pop up that asks if you are sure you want to exit, below is the code that I have for the skinnable pop up container:
protected function yesExit(event:MouseEvent):void
<s:Label text="Are you sure you want to exit?" width="100%" />
<s:HGroup width="100%" horizontalAlign="center" >
<s:Button label="Yes" click="yesExit(event)" width="40%" />
<s:Button label="No" click="this.close()" width="40%" />
I tried using something like "parent.poptofirstview" but that doesn't work, and right now I'm stuck. Any help would be appreciated. thanks!
You need to add an event listener for PopUpEvent.CLOSE on whatever view is creating the pop up. Then in the handler for that listener, you can do a navigator.popToFirstView() You'll also have to pass some type of data along with the close event so that you'll know whether the window was closed because "yes" was selected or "no".
thanks a lot, this worked perfectly!