Button.onRollOver( ) Event Handler

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
Button.onRollOver( ) Event Handler Flash 6; on(rollOver) supported since Flash 2

occurs when the pointer moves over the button (if mouse is not depressed) or when the button gains keyboard focus
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



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net