Button object

Availability

Flash Player 6.

All button symbols in a Flash movie are instances of the Button object. You can give a button an instance name in the Property inspector, and use the methods and properties of the Button object to manipulate buttons with ActionScript. Button instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel.

The Button object inherits from the Object object.

Method summary for the Button object

Method Description
Button.getDepth() Returns the depth of a button instance.

Property summary for the Button object

Property Description
Button._alpha The transparency value of a button instance.
Button.enabled Indicates whether a button is active.
Button._focusrect Indicates whether a button with focus has a yellow rectangle around it.
Button._height The height of a button instance, in pixels.
Button._highquality Indicates the rendering quality of the movie.
Button.menu  
Button._name The instance name of a button instance.
Button._parent A reference to the movie clip instance that is the parent of this instance.
Button._quality Indicates the rendering quality of the movie.
Button._rotation The degree of rotation of a button instance.
Button._soundbuftime Number of seconds for a sound to preload.
Button.tabEnabled Indicates whether a button is included in automatic tab ordering.
Button.tabIndex Indicates the tab order of an object.
Button._target The target path of a button instance.
Button.trackAsMenu Indicates whether other buttons can receive mouse release events.
Button._url The URL of the SWF file that created the button instance.
Button.useHandCursor Indicates whether the pointing hand is displayed when the mouse passes over a button.
Button._visible A Boolean value that determines whether a button instance is hidden or visible.
Button._width The width of a button instance, in pixels.
Button._x The x coordinate of a button instance.
Button._xmouse The x coordinate of the pointer relative to a button instance.
Button._xscale The value specifying the percentage for horizontally scaling a button instance.
Button._y The y coordinate of a button instance.
Button._ymouse The y coordinate of the pointer relative to a button instance.
Button._yscale The value specifying the percentage for vertically scaling a button instance.

Event handler summary for the Button object

The following table lists the event handler summaries for the Button object.

Event handler Description
Button.onDragOut Invoked when the mouse button is pressed over the button and the pointer then rolls outside the button.
Button.onDragOver Invoked when the user presses and drags the mouse button outside and then over the button.
Button.onKeyUp Invoked when a key is released.
Button.onKillFocus Invoked when focus is removed from a button.
Button.onPress Invoked when the mouse is pressed while the pointer is over a button.
Button.onRelease Invoked when the mouse is released while the pointer is over a button.
Button.onReleaseOutside Invoked when the mouse is released while the pointer is outside the button after the button is pressed while the pointer is inside the button.
Button.onRollOut Invoked when the pointer rolls outside of a button area.
Button.onRollOver Invoked when the mouse pointer rolls over a button.
Button.onSetFocus Invoked when a button has input focus and a key is released.