Button.onkillfocus - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Button.onKillFocus

Availability
Flash Player 6.
Usage
my_btn.onKillFocus = function (newFocus:Object) : Void {
// your statements here
}
Parameters
The object that is receiving the focus.
newFocus
Returns
Nothing.
Description
Event handler; invoked when a button loses keyboard focus. The
one parameter,
newFocus
no object receives the focus,
Example
The following example demonstrates how statements can be executed when a button loses focus.
Create a button instance on the Stage called my_btn and add the following 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
148
Chapter 2: ActionScript Language Reference
, which is an object representing the new object receiving the focus. If
contains the value
newFocus
onKillFocus
.
null
output_txt
handler receives
text field.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents