Key.isDown()
Availability
Flash Player 5.
Usage
Key.isDown(keycode)
Parameters
The key code value assigned to a specific key, or a Key class property associated with a
keycode
specific key. To match the returned key code value with the key on a standard keyboard, see
Appendix C, "Keyboard Keys and Key Code Values," on page
Returns
A Boolean value.
Description
Method; returns
Macintosh, the key code values for the Caps Lock and Num Lock keys are identical.
Example
The following script lets the user control a movie clip's location.
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT)) {
this._x=_x+10;
} else if (Key.isDown(Key.DOWN)) {
this._y=_y+10;
}
}
Key.isToggled()
Availability
Flash Player 5.
Usage
Key.isToggled(keycode)
Parameters
The key code for Caps Lock (20) or Num Lock (144).
keycode
Returns
A Boolean value.
Description
Method; returns
On the Macintosh, the key code values for the Caps Lock and Num Lock keys are identical.
414
Chapter 12: ActionScript Dictionary
if the key specified in
true
if the Caps Lock or Num Lock key is activated (toggled),
true
789.
is pressed,
keycode
false
if it is not. On the
if it is not.
false
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers