I have in Flex a TabNavigator container and in all tabs I have the same view (a bunch of buttons and a grid).
<mx:TabNavigator id="myTabThing">
<mx:VBox label="First tab"
width="100%"
height="100%">
<view:myView/>
</mx:VBox>
<mx:VBox label="Second tab"
width="100%"
height="100%">
<view:myView/>
</mx:VBox>
</mx:TabNavigator>
How can I, in myView.mxml, get grasp on data of the tab navigator thing? I should very much like to be able to do something such as:
<mx:Text text="{myTabThing.selectedChild}"/>
Or actually something more complicated based on the selected child (change the populating of the list inside the myView view).
Total Flex newbie here, so sorry if my question is dumb.
Adding "this.parentDocument" will let you know the current tab.In this case,try
<mx:Text text="{this.parentDocument.myTabThing.selectedChild}"/>
If you want to change the list in MyView based on the parent, check with the "selectedChild"'s id.Give the VBoxes an id and then check with the id like this
<mx:VBox id ="firstTab" label="First tab"
width="100%"
height="100%">
<local:myView/>
if(this.parentDocument.myTabThing.selectedChild.id == "firstTab"){...}