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

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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.

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
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
handler:
and add the following
my_btn
output_txt
Button
283

Advertisement

Table of Contents
loading

Table of Contents