shivang
shivang

Reputation: 27

Get information of Tabs open in TabNavigator in flex

alt text http://img195.imageshack.us/img195/7845/tabx.jpg

i am opening tabs with click event on tree list view.

Problem is that i do not want open tab Pista as u can see in image again.

i want to focus that open Pista tab.

Pls give ur suggestions.

Thanks.

Regards,

Shivang

Upvotes: 1

Views: 2108

Answers (1)

Chris Klepeis
Chris Klepeis

Reputation: 9973

You could have a function that loops through the tabs to see if the tab already exists and if it does set the tabNavigators selectedIndex, if it doesnt add the new tab

var tabFound:Boolean = false;
for(var i:int = 0; i < myTabNavigator.numChildren; i++)
{
    if(myTabNavigator.getChildAt(i) is myNewObj)
    {
       myTabNavigator.selectedIndex = i;
       tabFound = true;
       break;
    }
}
if(!tabFound)
{
    myTabNavigator.addChild(myNewObj);
}

I quickly wrote that code up and didnt test it, but the logic would be similar.

Upvotes: 3

Related Questions