Button.tabIndex Property

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

specifies the button's index in the custom tab order read/write
theButton.tabIndex

Description

The integer tabIndex property specifies theButton's position in the custom tab order. When no text field, clip, or button has a tabIndex property defined, Flash determines the tab order automatically, and pressing the Tab key moves focus between buttons and text fields from right to left, then top to bottom. Use the tabIndex property to force Tab key navigation to follow a custom 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 object without an assigned tabIndex cannot be accessed via the Tab key.

By default, buttons are tab-enabled, so the tabEnabled property need only be set to exclude a button from the tab order while retaining its tabIndex value (allowing segments of a keyboard-controlled interface to be disabled and restored with minimal effort).

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 three buttons, in this order: jump_btn, moveLeft_btn, moveRight_btn. The order applies regardless of the position of the buttons on screen.

jump_btn.tabIndex = 1; moveLeft_btn.tabIndex = 2; moveRight_btn.tabIndex = 3;

See Also

Button.tabEnabled, TextField.tabIndex, MovieClip.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