2 Replies Latest reply on Jul 26, 2007 1:04 PM by schjlatah

    TabNavigator & States

    FRBAmy
      I have a TabNavigator and I want to use states to select which component is showing in each tab. Each tab has 4 different components. Is this feasible or am I just crazy? It looks like it is only working on the first tab, because when it is initialized the state is set. In the other tabs, it doesn't appear that the state is affected.

      Please help!

        • 1. Re: TabNavigator & States
          schjlatah Level 1
          Have you looked into using nested ViewStacks? Instead of using states of the TabNavigator component, you could try making each parent tab a ViewStack then nest the components in each stack component. That may not make much sense, but I think it may work.
          • 2. Re: TabNavigator & States
            schjlatah Level 1
            After re-reading this, you could try making a custom component, which has the four components you want in it. Then programmatically set their visibility and includeInLayout to true or false.
            Use multiple instances of these components for the children of your tabNavigator. By virtue of them being separate components they should keep their state when you switch around between them. Like this:

            <mx:TabNavigator>
            <custom:customComponent hiddenValues="{whichOnesToHide1}" />
            <custom:customComponent hiddenValues="{whichOnesToHide2}" />
            <custom:customComponent hiddenValues="{whichOnesToHide3}" />
            </mx:TabNavigator>

            This might be a little closer to what you're looking for.