tags:

views:

990

answers:

1
+3  A: 

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.

Chris Klepeis
Hey Thanks Chirs,It works really good.
shivang