
Button.onSetFocus() Event Handler
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
469
See Also
Button.onDragOut(), Button.onRollOver(), MovieClip.onRollOut(); Chapter 10
Button.onRollOver() Event Handler
occurs when the pointer moves over the button (if mouse is not depressed) or when the button gains keyboard focus
Flash 6; on(rollOver) supported since Flash 2
theButton.onRollOver()
on (rollOver) {
statements
}
Description
The onRollOver() event handler executes when the mouse pointer moves into the hit area
of a button without the mouse button depressed. It also executes when
theButton gains
keyboard focus, as described under Button.onSetFocus(). The rollOver event is not required
to depict visual states for a button, because visual button changes are created directly in the
authoring tool, not with scripting. You should use the provided Up, Over, and Down
frames in the authoring tool to create highlight states for buttons.
The rollOver event provides a handy means of retrieving a text field selection. For more
details, see TextField.replaceSel() and the Selection object.
Example
cancel_btn.onRollOver = function () {
trace("rollOver detected");
};
See Also
Button.onDragOut(), Button.onRollOut(), Button.onSetFocus(), MovieClip.onRollOver();
Chapter 10
Button.onSetFocus() Event Handler
callback invoked when the ...