Key.HOME
Availability
Flash Player 5.
Usage
Key.HOME:Number
Description
Property; constant associated with the key code value for the Home key (36).
Example
The following example attaches a draggable movie clip called
0,0. When you press the Home key, car_mc returns to 0,0. Create a movie clip that has a linkage
ID
, and add the following ActionScript to Frame 1 of the Timeline:
car_id
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);
at the x and y coordinates of
car_mc
Key.HOME
355
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?