Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Key > TAB (Key.TAB property) | |||
public static TAB : Number
The key code value for the Tab key (9).
Availability: ActionScript 1.0; Flash Player 5
The following example creates a text field, and displays the date in the text field when you press Tab.
this.createTextField("date_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
date_txt.autoSize = true;
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.TAB)) {
var today_date:Date = new Date();
date_txt.text = today_date.toString();
}
};
Key.addListener(keyListener);
When you use this example, be sure to select Control > Disable Keyboard Shortcuts in the test environment.
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player 7 or later. If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001775.html