Onkeyup (Key.onkeyup Event Listener); Pgdn (Key.pgdn Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

onKeyUp (Key.onKeyUp event listener)

onKeyUp = function() {}
Notified when a key is released. To use
then define a function for
Key object, as shown in the following example:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
trace("DOWN -> Code: "+Key.getCode()+"\tACSII: "+Key.getAscii()+"\tKey:
"+chr(Key.getAscii()));
};
keyListener.onKeyUp = function() {
trace("UP -> Code: "+Key.getCode()+"\tACSII: "+Key.getAscii()+"\tKey:
"+chr(Key.getAscii()));
};
Key.addListener(keyListener);
Listeners enable different pieces of code to cooperate because multiple listeners can receive
notification about a single event.
Availability: ActionScript 1.0; Flash Lite 2.0
See also
addListener (Key.addListener method)

PGDN (Key.PGDN property)

public static PGDN :
The key code value for the Page Down key (34).
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example rotates a movie clip called
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);
384
ActionScript classes
onKeyUp
and use
onKeyUp
addListener()
Number
, you must create a listener object. You can
to register the listener with the
when you press the Page Down and
car_mc

Advertisement

Table of Contents
loading

Table of Contents