Pgup (Key.pgup Property); Removelistener (Key.removelistener Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

PGUP (Key.PGUP property)

public static PGUP : Number
The key code value for the Page Up key (33).
Availability: ActionScript 1.0; Flash Player 5
Example
The following example rotates a movie clip called
Page Up key.
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);

removeListener (Key.removeListener method)

public static removeListener(listener:Object) : Boolean
Removes an object previously registered with
Availability: ActionScript 1.0; Flash Player 6
Parameters
- An object.
listener:Object
Returns
- If the
Boolean
listener
was not successfully removed (for example, because the
listener
Key object's listener list), the method returns
Example
The following example moves a movie clip called
The listener is removed when you press Escape, and
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
case Key.LEFT :
car_mc._x -= 10;
688
ActionScript classes
Key.addListener()
was successfully removed, the method returns
false
when you press the Page Down or
car_mc
.
listener
.
using the Left and Right arrow keys.
car_mc
no longer moves.
car_mc
. If the
true
was not on the

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF