User Guide
Key.HOME 355
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 car_mc at the x and y coordinates of
0,0. When you press the Home key, car_mc returns to 0,0. Create a movie clip that has a linkage
ID
car_id, and add the following ActionScript to Frame 1 of the Timeline:
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);