Skip navigation
Currently Being Moderated

FB 4.6 Mobile - TabbedViewNavigator selectedIndex not working

May 28, 2012 5:48 PM

Tags: #air3 #tabbedviewnavigator #4.6 #flex4.6

I have a Mobile Project in FB 4.6 with a TabbedViewNavigator. I have 4 buttons at the bottom, which are ViewNavigators, and act as the Tabs. For this instance, lets say the tabs are labeled, HOME, ADD, DELETE, and ABOUT. I am running into the following situation:

  1. User presses the ADD tab.
  2. In the ADD screen, user clicks on several links which takes them away from the ADD tab's firstView and to a new view all together. For this instance, let's say the active view is called PlayersView.
  3. User now clicks another tab, for example HOME.
  4. User decides to go back to the ADD tab. However, upon pressing the ADD tab, the user is taken to the last view, which in this case was the PlayersView.

 

How can I have the functionality changed so that upon pressing a Tab, the user is ALWAYS taken to the firstView property of that tab. As referenced above, this is not happening. I have tried creating an IndexChangeEvent listener on the tabbedNavigator and then changing the tabbedNavigator's selectedIndex, however this doesn't work.

 

protected function tabbedviewnavigatorapplication1_applicationCompleteHandler(event:FlexEvent):void {

          this.tabbedNavigator.addEventListener(IndexChangeEvent.CHANGE,onIndexChange);
}


protected function onIndexChange(event:IndexChangeEvent):void {

          this.tabbedNavigator.selectedIndex = event.newIndex;
          trace(' THIS DOESN'T WORK');

}


 

Any help is appreciated. Thanks, in advance.

 
Replies
  • Currently Being Moderated
    Jan 2, 2013 8:28 AM   in reply to sleblang

    Hi sleblang,

     

    Did you manage to get an answer to your question?  I am also struggling with this problem!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 2, 2013 10:06 AM   in reply to sleblang

    Thanks very much - exactly what I was after.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points