This is a summation of and my response to this post on Kirupa.com, concerning tab indexing and TextField objects.

dColumbus put a number of TextField objects on the stage. He (correctly) assigned them a tabIndex value. There was some speculation that the objects were not loaded before the tabIndex was assigned, that the objects were removed from the stage using removeChild(). Neither of these was the case, since the Actionscript was actually in the Actions of the frame where the TextField resided.

The solution is very simple, but non-intuitive, and not documented well in Adobe docs.

The problem is that the TextField’s were registered as “Dynamic Text”. Using “Input Text” instead, a tabIndex can be assigned.

I don’t know why this is the case. In my opinion, all DisplayObject classes should able to use tabIndex. But, clearly, the decision was made by Adobe to have Flash Player manage focus only for objects that were pre-defined in Flash to take user input; for example, Buttons, “Input Text” TextFields, etc.

This is not at all clear when you read the Adobe docs on IFocusManagerComponent nor the FocusManager reference. The most that is said is, “All components that can be managed by a FocusManager instance must implement the fl.managers.IFocusManagerComponent interface. Objects for which Flash Player manages focus are not required to implement the IFocusManagerComponent interface.” There is no detail on which components are managed.

But, like the docs say, you can add focus functionality to any extended class by implementing the IFocusManagerComponent.

– 30 –

Advertisements