You can toggle the enabled property of the second ViewNavigator. Setting it to false will make the tab disabled.
thank you for your help me, but I didn't find, how I can obtain access from first tab to the second tab.
If I tryed mySecondTab + dot , I didn't see enable property, if I tryed
var mySecondTab:MySecondTab = new MySecondTab();
mySecondTab.enable = false;
this code works fine, but without any result in my live tab (it is ok, I created new instance of my tab, it doesn't work with my "live" tab).
Next I tryed obtain object from
//name mySecondTab is a name in id properties
//name MySecondTab is a name of component in a project
but both function returns null.
This was my hacky way of getting to the second ViewNavigator
In my View:
var navTwo:ViewNavigator = TabbedViewNavigatorApplication(FlexGlobals.topLevelApplication).navigators as ViewNavigator;
navTwo.enabled = !navTwo.enabled;
<s:navigators> <s:ViewNavigator id="navOne" label="One" firstView="views.SecondView"/> <s:ViewNavigator id="navTwo" label="Two" firstView="views.SPUCHomeView" enabled="false"/> </s:navigators>
Hi, thank you for your code. It works perfect.