Question

I have a mx Tab navigator and added several childs...I can use selectedindex(int) to open/select the respective (int) tab but How do I know the value of a selected/open tab???

Any Ideas.

Please help

Was it helpful?

Solution

You need selectedIndex property (it is readable/writable). Also see Event.CHANGED to catch tab change.

OTHER TIPS

You mean the navigator content?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955"
               minHeight="600">


    <fx:Script>
        <![CDATA[
            import mx.core.INavigatorContent;
            import mx.events.IndexChangedEvent;

            protected function tabNavigator_changeHandler(event:IndexChangedEvent):void
            {
                var obj:INavigatorContent = tabNavigator.selectedChild;
            }
        ]]>
    </fx:Script>

    <mx:TabNavigator id="tabNavigator"
                     change="tabNavigator_changeHandler(event)" />

</s:Application>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top