This content has been marked as final. Show 2 replies
Doesn't this work?:
myTabs.selectedIndex=0, myTabs.selectedIndex=1, etc.
Or am I oversimplifying what you need?
Do you have any code examples of what you are trying to do?
There is a problem with setting tabIndex. Part of the problem is that the default value (-1) comes before any other setable value.
This alone is not a problem for simple scenarios. If you set the tabIndex of one component on a screen, you probably set it for all the sibling components as well.
Now mix into the bag custom components (particularly ones with changing states that add/remove controls).
The problem is when you have custom components that use a tabIndex for their "internal" controls, but you don't use a tabIndex for the controls that exist as siblings to the custom component itself:
<mx:TextInput id="mainText" />
<mx:TextInput tabIndex="1" id="subText1" />
<mx:TextInput tabIndex="2" id="subText2" />
<mx:TextInput id="mainText2" />
<mx:Button label="submit" />
In this scenario, the tab focus moves from mainText -> mainText2 -> submit Button -> subText1 -> subText2
because... mainText, mainText2, and the submit Button all have tabIndices of -1 which comes before 1 and 2. Flex 2.0 quite presumptively ignores the fact that subText1 and subText2 are tab children of the form component. This is not the way it worked in Flex 1.5 and is a very frustrating problem. You could solve the problem above by setting the tabIndex of mainText to 0, mainText2 to 3, and the Button to 4 but then, what will you do when you use the custom form component in another file with different controls? What will you do if you need to add another TextInput in front of mainText?
The end result is that you cannot use tabIndex in custom components for probably 90% of all flex projects (and the remaining 10% are probably so simple you don't NEED to use tabIndex). One step forward for Flex version number, two steps back for developers.
thus ends the sad, sad tale of tabindex problems in flex 2.0