MovieClip.tabIndex Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
MovieClip.tabIndex Property Flash 6

specifies the movie clip's index in the custom tab order read/write
mc.tabIndex

Description

The integer tabIndex property specifies mc's position in the custom tab order. When no text field, clip, or button has a tabIndex property defined, Flash determines tab order automatically, and pressing the Tab key moves focus between movie clips with button handlers, buttons, and text fields from right to left, then top to bottom. We use the tabIndex property to force Tab key navigation to follow our own sequence, overriding the automatic order. For complete details, see TextField.tabIndex.

Objects with _visible set to false are not included in the tab order. When at least one object has tabIndex set, any objects without an assigned tabIndex cannot be accessed via the Tab key.

By default, movie clips are not tab-enabled unless they define button handlers. To include in the automatic tab order a movie clip that does not define button handlers, set its tabEnabled property to true. To include any movie clip in a custom tab order, set its tabIndex property to an integer (the tabEnabled property need not also be set). A movie clip without button handlers typically is added to the automatic or custom tab order when it is an interface element that is keyboard accessible (in which case, it typically responds to keyboard control via either Key.onKeyUp( ) or MovieClip.onKeyUp( )).

Usage

The Tab key does not work reliably in Test Movie mode unless Control figs/u2192.gif Disable Keyboard Shortcuts is enabled. Be sure to test keyboard behavior in the Standalone Player, if applicable, and in the Flash Player for all targeted web browsers.

Example

The following code restricts Tab key access to a listbox movie clip, a text field, and a Submit button:

phoneListBox_mc.tabIndex = 1; firstName_txt.tabIndex = 2; submit_btn.tabIndex = 3;

See Also

MovieClip.tabChildren, MovieClip.tabEnabled, TextField.tabIndex



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net