5 Replies Latest reply on Jan 17, 2009 7:35 PM by Mainmanian

    TabNavigator change

    Mainmanian Level 1
      I employ a TabNavigator container in my site and there are three tabs; T1, T2 and T3. When T1 is clicked, I change the currentState to S1 and in that window, I have a button "play" which when I click, starts a video window and plays a file. Midway thru that play back, I click T2 and I have coded it to change state to S2. I get my job done in S2 and I click back to T1, it takes me to the video playback screen which is playing that file. I want it to go to the first state S1 which has a screen that displays the "play" button. Can someone help me with this issue? Thanks, Ramesh
        • 1. Re: TabNavigator change
          ntsiii Level 3
          I am not follwoing your application structure. Where are these states? On T1, T2, or T3? Where is "window", how is it implemented. What, where is "video window", how is it implemented? Mixing states with TabNavigator is a very odd thing to do.

          Maybe post some code. Use the Attach Code button please if you do.

          Hmm, are you using *TabBar*, and not TabNavigator?
          • 2. Re: TabNavigator change
            EWN-CMI Level 1
            Mainmanian - I think that if you are using states that you could set the default state in a function based on the selectedIndex of the tabNavigator on a change event on the tabNavigator. Good Luck.

            I believe I have the same issue. Basically the child objects under a TabNavigator page are not reset to their initial state once they have been accessed. For example, if there are 2 tabs on the tabNavigator - T1 has a canvas with some test objects on it, T2 has a canvas with a swf movie on it. When T2 is selected, the swf loads and begins playing, then if T1 is selected the text objects are viewed, then if T2 is selected again the swf movie is still playing as if it had always been selected instead of stopping when focus was lost when T1 was selected. Basically, how does one reset the contents of a tab to it's original state, so that each time a user selects that tab any actions previously taken are lost or reset. In my case, the swf movie would reset and start from the beginning. In Mainmanian's case, he wants the movie to be removed and the button to control reloading it.
            • 3. Re: TabNavigator change
              Mainmanian Level 1
              Thank you EWN-CMI and ntsiii: I apologize for being inarticulate on this subject. I am new to Flex and still learning the right terminology. My issue is identical to EWN-CMI and this person described the problem I think well. I need a way to reset a tab to its original state if the focus shifts to a different tab.

              My code has gotten a little too complex and unwieldy to just post one part of it. If EWN-CMI's comment is not enough, I can perhaps put the entire code up on some site. Thank you all very much for helping me with this. Cheers, Ramesh
              • 4. Re: TabNavigator change
                ntsiii Level 3
                Are you using the word "state" in its specific, technical Flex sense? Or in the general sense?

                You can use the show event of the TabNavigator's child containers, which fire each time the child view is shown. Have that handler set the state to whatever is desired.
                • 5. Re: TabNavigator change
                  Mainmanian Level 1
                  I believe taht I am using teh word state in the Flex technical sense. I will try the show event to see if I it sheds any light. Thanks