8 Replies Latest reply on Jul 11, 2008 12:56 AM by jonesf

    Views, States,  Memory and Unloading

    jonesf
      I'm having a hard time grasping some basic concepts. The Flex app that I'm building is quite large with many views, forms, etc.

      Currently I have the main sections of my application mapped out into about 10 views in a view stack. Each one of those views/containers can have several states. My understanding is that the objects in these views and states are created on-demand, which is nice, but how the heck to I UNLOAD them??
      It looks to me like the default behavior would continue loading and *keeping* all these views and states in memory indefinitely until potentially every aspect of the application is loaded in memory (every view, every tool, every form, etc).
      For example, when the user switches from ViewItem1 to ViewItem2 in a ViewStack, how can I completely unload the main object from ViewItem1 from memory so that it is completely re-created when the user goes back to it later? Same goes for switching between states...
      All I can find in the documentation is to use removeAllChildren(). That works fine for dynamic content, but the main top-level object would still be in memory and static content would never get reinitialized.
      Or what am I missing?

      Thanks