6 Replies Latest reply on Mar 22, 2009 7:47 AM by *gsb*

    Initializing ViewStack contents

    jeffreypritchard
      Hi,

      I'm using a ViewStack to for navigation in my application (instead of using states). I've made each of the separate views into components and everything works fine, except the view seems to be persistent. I understand why it remains in the same state (the ViewStack doesn't actually remove the old view, it just toggles _visible), but I'd like to make it so every time the selectedIndex on the ViewStack changes, it would be like calling the constructor on the new view (if it were an AS3 class and not MXML).

      My question is:

      What is the best event to use for initializing and destroying an MXML component in a view stack ? ADDED_TO_STAGE and doesn't work but the first time, and show and hide doesn't seem to refresh the display list either.

      Thanks for your time.