onSetFocus (MovieClip.onSetFocus handler)

onSetFocus = function(oldFocus:Object) {}

Invoked when a movie clip receives keyboard focus. The oldFocus parameter is the object that loses the focus. For example, if the user presses the Tab key to move the input focus from a movie clip to a text field, oldFocus contains the movie clip instance.

If there is no previously focused object, oldFocus contains a null value.

You must define a function that executes when the event handler in invoked. You can define the function on the timeline or in a class file that extends the MovieClip class or is linked to a symbol in the library.

Availability: ActionScript 1.0; Flash Player 6

Parameters

oldFocus:Object - The object to lose focus.

Example

The following example displays information about the movie clip that receives keyboard focus, and the instance that previously had focus. Two movie clips, called my_mc and other_mc are on the Stage. Add the following ActionScript to your AS or FLA document:

my_mc.onRelease = Void;
other_mc.onRelease = Void;
my_mc.onSetFocus = function(oldFocus) {
    trace("onSetFocus called, previous focus was: "+oldFocus);
}

Tab between the two instances, and information displays in the Output panel.

See also

onKillFocus (MovieClip.onKillFocus handler)


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001958.html