1 Reply Latest reply on Dec 6, 2008 4:30 PM by rtalton

    Code saving transitions

      I have a few stationary components in my app. Navbar, minis, etc. I also have MANY other "content sections" which need to be moved in and out as a result of clicking on navbar items. Upon clicking one of the items in the navbar, the current content section needs to animate off screen and the new content section needs to animate onto screen. I think I have the fundamentals of states and transitions down pretty well.

      What I'm trying to avoid is creating a transition from every content section to every other content section, since the previous needs to animate out first. This would increase the number of transitions exponentially with the addition of every screen. My desired approach is to save a reference to the currently displayed content section, so I can animate it out when a new nav item is selected. This will allow me to implement one transition per content section as such (with pseudocode):

      <mx:Transition fromState="*" toState="editProfileState">
      1. Animate out current content section
      2. remove current content section
      3. animate in "Edit Profile" content
      4. set "Edit Profile" content = current content section

      Is there a better way to do this? I suspect the answer is to do it programmatically.