MovieClip.onSetFocus
Availability
Flash Player 6.
Usage
my_mc.onSetFocus = function(oldFocus){
// your statements here
}
Parameters
The object to lose focus.
oldFocus
Returns
Nothing.
Description
Event handler; invoked when a movie clip receives keyboard focus. The
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,
If there is no previously focused object,
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. For more information, see "Assigning a class to a movie clip symbol" in Using
ActionScript in Flash.
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
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
MovieClip.onKillFocus
contains the movie clip instance.
oldFocus
contains a
oldFocus
parameter is
oldFocus
value.
null
and
my_mc
other_mc
MovieClip.onSetFocus
are on
569
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?