M > MovieClip.onKeyDown |
![]() ![]() ![]() |
MovieClip.onKeyDown
Availability
Flash Player 6.
Usage
myMovieClip
.onKeyDown
Parameters
None.
Returns
Nothing.
Description
Event handler; invoked when a movie clip has input focus and a key is pressed. The onKeyDown
event is invoked with no parameters. You can use the Key.getAscii
and Key.getCode
methods to determine which key was pressed.
You must define a function that executes when the event is invoked.
Example
The following example defines a function for the onKeyDown
method that sends a trace
action to the Output window:
myMovieClip.onKeyDown = function () { trace ("onKeyDown called"); };
See also
![]() ![]() ![]() |