1 Reply Latest reply on Jul 5, 2006 10:40 AM by ntsiii

    Flex application unloading

      I would like to be able to handle an event which is fired when my Flex 1.5 Application unloads. We need this to do some cleanup work essential to our application.

      I tried to use the unload event on the mx:Application object , but that does not seem to respond very well.

      How would I create or use an event which gets fired when the application unloads (as our mxml application runs in a popup window, this event has to be fired when the user closes the window)

      Thanks for any help,

        • 1. Re: Flex application unloading
          ntsiii Level 3
          Remember that Flex runs in the Flash Player in the browser. The main app never really unloads.

          I think you will need to use javascript and browser events to do what you want. Is your "clean-up" work inside the Flex app? If so, and you can catch an early enough event ( "onBeforeUnload" ?) from the browser, you can use myPlayerInstance.setVariable() to invoke some action in the Flex app.