Determining how a window is closed
I have a Flash application which I'm displaying in a popup. This application has its own close button to be used so that I can save some data to a database and I want to make sure that the users only use this button to close the app. I now have an onBeforeUnload action in the application window, but if the user uses the correct Flash close button, I still get the message. Is there a way to only display the message if the Windows X button or Alt-F4 is used to close the window?