EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Onpress (Button.onpress Handler); Onrelease (Button.onrelease Handler)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Button 283
Parameters
newFocus:Object - The object that is receiving 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
output_txt
text field.
onPress (Button.onPress handler)
onPress = function() {}
Invoked when a button is pressed. You must define a function that is executed when the event
handler is invoked.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
In the following example, a function that sends a trace() statement to the Output panel is
defined for the
onPress handler:
my_btn.onPress = function () {
trace ("onPress called");
};
onRelease (Button.onRelease handler)
onRelease = function() {}
Invoked when a button is released. You must define a function that is executed when the event
handler is invoked.
Availability: ActionScript 1.0; Flash Lite 2.0

Table of Contents

Related product manuals