public static isDown(code:Number) : Boolean
Returns true if the key specified in code is pressed; false otherwise.
code:Number - The key code value assigned to a specific key or a Key class property associated with a specific key.
Boolean - The value true if the key specified in code is pressed; false otherwise.
The following script lets the user control the location of a movie clip (car_mc):
car_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
this._x += 10;
} else if (Key.isDown(Key.LEFT)) {
this._x -= 10;
}
};