Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Adobe Flex SDK 4.5.1 (Release)
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
I've got a simple TabbedViewNavigator with 2 tabs. After an event, I want to remove all the tabs and add new ones. I tried this code:
public function doIt():void {
trace('called');
this.tabbedNavigator.removeAll();
var vn1:ViewNavigator = new ViewNavigator();
vn1.firstView = views.HomeView;
vn1.label = "Home";
this.tabbedNavigator.addItem(vn1);
}
Everything works fine at the removeAll. When I do addItem, I get this error:
RangeError: Index '1' specified is out of bounds.
at spark.components::TabbedViewNavigator/set selectedIndex()[E:\dev\trunk\frameworks\projects\mobilecomponents\src \spark\components\TabbedViewNavigator.as:1239]
at spark.components::TabbedViewNavigator/addItemAt()[E:\dev\trunk\framew orks\projects\mobilecomponents\src\spark\components\TabbedViewNavigato r.as:1379]
at spark.components::TabbedViewNavigator/addItem()[E:\dev\trunk\framewor ks\projects\mobilecomponents\src\spark\components\TabbedViewNavigator. as:1332]
at LoginRegisterExample/doIt()[C:\Users\Raymond\Adobe Flash Builder 4.5\LoginRegisterExample\src\LoginRegisterExample.mxml:19]
at views::LoginView/testClick()[C:\Users\Raymond\Adobe Flash Builder 4.5\LoginRegisterExample\src\views\LoginView.mxml:10]
at views::LoginView/___LoginView_Button1_click()[C:\Users\Raymond\Adobe Flash Builder 4.5\LoginRegisterExample\src\views\LoginView.mxml:19]
I also tried replacing removeAll with two removeItemAt(0) calls (I had 2 tabs). Again, that code worked - both tabs went away, but i got the same error when I tried to add an item. I also tried addItemAt(0).