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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Invoked when a movie clip receives input focus. The oldFocus parameter is the object that<br />

loses the focus. For example, if the user presses the Tab key to move the input focus from a<br />

movie clip to a text field, oldFocus contains the movie clip instance.<br />

If there is no previously focused object, oldFocus contains a null value.<br />

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

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

a symbol in the library.<br />

Parameters<br />

oldFocus:Object - The object to lose focus.<br />

Example<br />

The following example displays information about the movie clip that receives input focus,<br />

<strong>and</strong> the instance that previously had focus. Two movie clips, called my_mc <strong>and</strong> other_mc are<br />

on the Stage. Add the following ActionScript to your AS or FLA document:<br />

my_mc.onRelease = Void;<br />

other_mc.onRelease = Void;<br />

my_mc.onSetFocus = function(oldFocus) {<br />

trace("onSetFocus called, previous focus was: "+oldFocus);<br />

}<br />

When you press the Tab key between the two instances, information is displayed in the<br />

Output panel.<br />

See also<br />

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

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

onUnload = function() {}<br />

Invoked in the first frame after the movie clip is removed from the Timeline. Flash processes<br />

the actions associated with the onUnload event h<strong>and</strong>ler before attaching any actions to the<br />

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

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

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

Example<br />

The following example defines a function for the MovieClip.onUnload method that sends a<br />

trace() action to the Output panel:<br />

460 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!