Key.addListener(myListener);
my_btn.onPress = myOnPress;
my_btn._accProps.shortcut = "Ctrl+7";
Accessibility.updateProperties();
See also
getCode (Key.getCode method)
(Key.onKeyDown event listener)
removeListener (Key.removeListener method)
BACKSPACE (Key.BACKSPACE property)
public static BACKSPACE : Number
The key code value for the Backspace key (8).
Availability: ActionScript 1.0; Flash Player 5
Example
The following example creates a new listener object and defines a function for
The last line uses
addListener()
receive notification from the key down event.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.BACKSPACE)) {
trace("you pressed the Backspace key.");
} else {
trace("you DIDN'T press the Backspace key.");
}
};
Key.addListener(keyListener);
When you use this example, be sure to select Control > Disable Keyboard Shortcuts in the test
environment.
CAPSLOCK (Key.CAPSLOCK property)
public static CAPSLOCK : Number
The key code value for the Caps Lock key (20).
Availability: ActionScript 1.0; Flash Player 5
,
isDown (Key.isDown method)
,
onKeyUp (Key.onKeyUp event listener)
to register the listener with the Key object so that it can
,
onKeyDown
,
onKeyDown
Key
.
673
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?