onKillFocus (Button.onKillFocus handler)
onKillFocus = function(newFocus:Object) {}
Invoked when a button loses keyboard focus. The
parameter,
newFocus
object receives the focus,
Availability: ActionScript 1.0; Flash Player 6
Parameters
- The object that is receiving the focus.
newFocus:Object
Example
The following example demonstrates how statements can be executed when a button loses
focus. Create a button instance on the Stage called
ActionScript to Frame 1 of the Timeline:
this.createTextField("output_txt", this.getNextHighestDepth(), 0, 0, 300,
200);
output_txt.wordWrap = true;
output_txt.multiline = true;
output_txt.border = true;
my_btn.onKillFocus = function() {
output_txt.text = "onKillFocus: "+this._name+newline+output_txt.text;
};
Test the SWF file in a browser window, and try using the Tab key to move through the
elements in the window. When the button instance loses focus, text is sent to the
text field.
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
onPress (Button.onPress handler)
onPress = function() {}
Invoked when a button is pressed. You must define a function that executes when the event
handler is invoked.
Availability: ActionScript 1.0; Flash Player 6
364
ActionScript classes
, which is an object representing the new object receiving the focus. If no
contains the value
newFocus
MovieClip.getNextHighestDepth()
onKillFocus
.
null
and add the following
my_btn
method used in this example requires Flash Player
handler receives one
output_txt
method.
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?