User Guide
310 Chapter 6: ActionScript Core Classes
Key.PGUP
Availability
Flash Player 5.
Usage
Key.PGUP:Number
Description
Property; constant associated with the key code value for the Page Up key (33).
Example
The following example rotates a movie clip called car_mc when you press the Page Down and
Page Up keys.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.PGDN)) {
car_mc._rotation += 5;
} else if (Key.isDown(Key.PGUP)) {
car_mc._rotation -= 5;
}
};
Key.addListener(keyListener);
Key.removeListener()
Availability
Flash Player 6.
Usage
Key.removeListener (listener:Object) : Boolean
Parameters
listener
An object.
Returns
If the listener was successfully removed, the method returns true. If the listener was not
successfully removed (for example, because the
listener was not on the Key object’s listener list),
the method returns
false.
Description
Method; removes an object previously registered with Key.addListener().
Example
The following example moves a movie clip called car_mc using the Left and Right arrow keys.
The listener is removed when you press Escape, and
car_mc no longer moves.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {