EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Extendedkey

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
362 ActionScript classes
See also
message (Error.message property), throw statement, try..catch..finally
statement
ExtendedKey
Object
|
+-ExtendedKey
public class ExtendedKey
extends Object
Provides extended key codes that can be returned from the Key.getCode() method.
Availability: ActionScript 2.0; Flash Lite 2.0
Example
The following example creates a listener that is called when a key is pressed. It uses the
Key.getCode() method to get the key code for the key that was pressed:
var myListener = new Object();
myListener.onKeyDown = function() {
var code = Key.getCode();
switch(code) {
case 50:
trace("number 2 down");
break;
case Key.ENTER:
trace("enter down");
break;
case ExtendedKey.SOFT1:
trace("soft1 down");
break;
default:
trace(code + " down");
break;
}
}
myListener.onKeyUp = function() {
text2 = "onKeyUp called";
}
Key.addListener(myListener);

Table of Contents

Related product manuals