flex-users / flexlib

Open Source Flex components library.
github.com/flex-users/flexlib
MIT License
204 stars 91 forks source link

SuperTabNavigator index out of bounds #323

Open nicoulaj opened 13 years ago

nicoulaj commented 13 years ago

Originally filed by zeljko.kunica on 2010-07-20T19:17:38

What steps will reproduce the problem?

  1. create SuperTabNavigator (id=m_viewArea) and add 2 or more tabs
  2. execute the following code:

while (m_viewArea.getChildren().length > 0) { m_viewArea.removeChild(m_viewArea.selectedChild as DisplayObject); }

What is the expected output? What do you see instead? After all tabs are closed an error occures (index out of bounds...)

There is a simple solution:

  1. to the SuperTabNavigator.as, function ensureTabIsVisible add code:

if (this.selectedIndex < 0) { return; }