Table of Contents

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


Table of Contents