03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See also<br />

getAscii (Key.getAscii method), getCode (Key.getCode method), focusEnabled<br />

(MovieClip.focusEnabled property), setFocus (Selection.setFocus method),<br />

onKeyDown (Key.onKeyDown event listener), onKeyUp (MovieClip.onKeyUp<br />

h<strong>and</strong>ler)<br />

onKeyUp (MovieClip.onKeyUp h<strong>and</strong>ler)<br />

onKeyUp = function() {}<br />

Invoked when a key is released. The onKeyUp event h<strong>and</strong>ler is invoked with no parameters.<br />

You can use the Key.getAscii() <strong>and</strong> Key.getCode() methods to determine which key was<br />

pressed. You must define a function that executes when the event h<strong>and</strong>ler is invoked. You can<br />

define the function on the Timeline or in a class file that extends the MovieClip class or is<br />

linked to a symbol in the library.<br />

The onKeyUp event h<strong>and</strong>ler works only if the movie clip has input focus enabled <strong>and</strong> set.<br />

First, the MovieClip.focusEnabled property must be set to true for the movie clip. Then,<br />

the clip must be given focus. This can be done either by using Selection.setFocus() or by<br />

setting the Tab key to navigate to the clip.<br />

If Selection.setFocus() is used, the path for the movie clip must be passed to<br />

Selection.setFocus(). It is very easy for other elements to take the focus back after the<br />

mouse is moved.<br />

Example<br />

The following example defines a function for the onKeyUp method that sends a trace()<br />

action to the Output panel:<br />

my_mc.onKeyUp = function () {<br />

trace ("onKey called");<br />

}<br />

The following example sets input focus:<br />

my_mc.focusEnabled = true;<br />

Selection.setFocus(my_mc);<br />

See also<br />

getAscii (Key.getAscii method), getCode (Key.getCode method), focusEnabled<br />

(MovieClip.focusEnabled property), setFocus (Selection.setFocus method),<br />

onKeyDown (Key.onKeyDown event listener), onKeyDown (MovieClip.onKeyDown<br />

h<strong>and</strong>ler)<br />

454 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!