Flash Lite 2.x and 3.0 ActionScript Language Reference

Button

Object
    |
    +-Button

public class Button
extends Object

All button symbols in a SWF file 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 class 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 class inherits from the Object class.

See also

Object

Property summary

Modifiers

Property

Description

 

_alpha:Number

The alpha transparency value of the button specified by my_btn.

 

enabled:Boolean

A Boolean value that specifies whether a button is enabled.

 

_focusrect:Boolean

A Boolean value that specifies whether a button has a yellow rectangle around it when it has input focus.

 

_height:Number

The height of the button, in pixels.

 

_highquality:Number

Deprecated since Flash Player 7. This property was deprecated in favor of Button._quality.

Specifies the level of anti-aliasing applied to the current SWF file.

 

_name:String

Instance name of the button specified by my_btn.

 

_parent:MovieClip

A reference to the movie clip or object that contains the current movie clip or object.

 

_quality:String

Property (global); sets or retrieves the rendering quality used for a SWF file.

 

_rotation:Number

The rotation of the button, in degrees, from its original orientation.

 

_soundbuftime:Number

Specifies the number of seconds a sound prebuffers before it starts to stream.

 

tabEnabled:Boolean

Specifies whether my_btn is included in automatic tab ordering.

 

tabIndex:Number

Lets you customize the tab ordering of objects in a SWF file.

 

_target:String [read-only]

Returns the target path of the button instance specified by my_btn.

 

trackAsMenu:Boolean

A Boolean value that indicates whether other buttons or movie clips can receive a release event from a mouse or stylus.

 

_url:String [read-only]

Retrieves the URL of the SWF file that created the button.

 

_visible:Boolean

A Boolean value that indicates whether the button specified by my_btn is visible.

 

_width:Number

The width of the button, in pixels.

 

_x:Number

An integer that sets the x coordinate of a button relative to the local coordinates of the parent movie clip.

 

_xmouse:Number [read-only]

Returns the x hasMouse is true relative to the button.

 

_xscale:Number

The horizontal scale of the button as applied from the registration point of the button, expressed as a percentage.

 

_y:Number

The y coordinate of the button relative to the local coordinates of the parent movie clip.

 

_ymouse:Number [read-only]

Returns the y coordinate of the mouse position relative to the button.

 

_yscale:Number

The vertical scale of the button as applied from the registration point of the button, expressed as a percentage.

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)

Event summary

Event

Description

onDragOut = function() {}

Invoked when the user presses the mouse button over the button and then drags the pointer outside of the button.

onDragOver = function() {}

Invoked when the user presses the mouse button outside of the button and then drags the pointer over the button.

onKeyDown = function() {}

Invoked when a button has keyboard focus and a key is pressed.

onKeyUp = function() {}

Invoked when a button has input focus and a key is released.

onKillFocus = function(newFocus:Object) {}

Invoked when a button loses keyboard focus.

onPress = function() {}

Invoked when a button is pressed.

onRelease = function() {}

Invoked when a button is released.

onReleaseOutside = function() {}

Invoked when the mouse is released with the pointer outside the button after the mouse button is pressed with the pointer inside the button.

onRollOut = function() {}

Invoked when the button loses focus.

onRollOver = function() {}

Invoked when the button gains focus.

onSetFocus = function(oldFocus:Object) {}

Invoked when a button receives keyboard focus.

Method summary

Modifiers

Signature

Description

 

getDepth() : Number

Returns the depth of the button instance.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)