The Key Object

     

The Key Object

Table A.10. Key Object Methods and Constants

Name

Method/Attribute/Event

Format

Description

Key.addListener

M

Key.addListener (myObject)

Registers myObject to receive notification when the onKeyDown and onKeyUp methods are invoked.

Key.getAscii

M

Key.getAscii()

Returns the ASCII value of the last key pressed.

Key.getCode

M

Key.getCode()

Returns the keycode of the last key pressed.

Key.isDown

M

Key.isDown ( charCode )

Returns true if the user presses the key whose character code is charCode .

Key.isToggled

M

Key.isToggled ( charCode )

Returns true if the key specified in charCode is activated. On the PC, charCode for Caps Lock is 20; for Num Lock, 144; and for Scroll Lock, 145. You can use Key.CAPSLOCK for Caps Lock.

Key.removeListener

M

Key.removeListener (myObject)

If myObject was previously registered with Key.addListener() , myObject is removed from the list of listeners.

Key.BACKSPACE

A

Key.BACKSPACE

Constant associated with the keycode value for the Backspace key (8).

Key.CAPSLOCK

A

Key.CAPSLOCK

Constant associated with the keycode value for the Caps Lock key (20).

Key.CONTROL

A

Key.CONTROL

Constant associated with the keycode value for the Control key (17).

Key.DELETEKEY

A

Key.DELETEKEY

Constant associated with the keycode value for the Delete key (46).

Key.DOWN

A

Key.DOWN

Constant associated with the keycode value for the Down Arrow key (40).

Key.END

A

Key.END

Constant associated with the keycode value for the End key (35).

Key.ENTER

A

Key.ENTER

Constant associated with the keycode value for the Enter key (13).

Key.ESCAPE

A

Key.ESCAPE

Constant associated with the keycode value for the Escape key (27).

Key.HOME

A

Key.HOME

Constant associated with the keycode value for the Home key (36).

Key.INSERT

A

Key.INSERT

Constant associated with the keycode value for the Insert key (45).

Key.LEFT

A

Key.LEFT

Constant associated with the keycode value for the left arrow key (37).

Key.PGDN

A

Key.PGDN

Constant associated with the keycode value for the Page Down key (34).

Key.PGUP

A

Key.PGUP

Constant associated with the keycode value for the Page Up key (33).

Key.RIGHT

A

Key.RIGHT

Constant associated with the keycode value for the right arrow key (39).

Key.SHIFT

A

Key.SHIFT

Constant associated with the keycode value for the Shift key (16).

Key.SPACE

A

Key.SPACE

Constant associated with the keycode value for the spacebar (32).

Key.TAB

A

Key.TAB

Constant associated with the keycode value for the Tab key (9).

Key.UP

A

Key.UP

Constant associated with the keycode value for the up arrow key (38).

Key.onKeyDown

E

myObject.onKeyDown = function() { };

Fires when a key is pressed.

Key.onKeyUp

E

myObject.onKeyUp = function() { };

Fires when a key is released.




Using Macromedia Studio MX 2004
Special Edition Using Macromedia Studio MX 2004
ISBN: 0789730421
EAN: 2147483647
Year: N/A
Pages: 339

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