Flash Player 6.
my_mc
.onKeyUp
None.
Nothing.
Event; invoked when a key is released. The onKeyUp
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.
The movie clip must have input focus enabled and set in order for the onKeyUp
event to work. First, the focusEnabled
property must be set to true
for the movie clip. Then, the clip must be given focus. This can be done either by using the Selection.setFocus
method or by setting the tab key to navigate to the clip.
If the Selection.setFocus
method is used, the path for the movie clip must be passed to the Selection.setFocus
method. It is very easy for other elements to take the focus back once the mouse is moved.
The following example defines a function for the onKeyUp
method that sends a trace
action to the Output window.
my_mc.onKeyUp = function () { trace ("onKeyUp called"); };
The following example sets input focus:
MovieClip.focusEnabled = true; Selection.setFocus(MovieClip);