MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 305

Actionscript language reference
Table of Contents

Advertisement

this.attachMovie("car_id", "car_mc", this.getNextHighestDepth(), {_x:0,
_y:0});
car_mc.onPress = function() {
this.startDrag();
};
car_mc.onRelease = function() {
this.stopDrag();
};
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.HOME)) {
car_mc._x = 0;
car_mc._y = 0;
}
};
Key.addListener(keyListener);
Key.INSERT
Availability
Flash Player 5.
Usage
Key.INSERT:Number
Description
Property; constant associated with the key code value for the Insert key (45).
Example
The following example creates a new listener object and defines a function for
last line uses
addListener()
notification from the key down event and write information to the log file.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.INSERT)) {
trace("You pressed the Insert key.");
}
};
Key.addListener(keyListener);
Key.isDown()
Availability
Flash Player 5.
Usage
Key.isDown(keycode:Number) : Boolean
to register the listener with the Key object so that it can receive
. The
onKeyDown
Key.isDown()
305

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents