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.

Availability: ActionScript 1.0; Flash Player 6

See also

Object

Property summary

Modifiers

Property

Description

 

_alpha:Number

The alpha transparency value of the button specified by my_btn.

 

blendMode:Object

The blend mode for the button.

 

cacheAsBitmap:Boolean

If set to true, Flash Player caches an internal bitmap representation of the button.

 

enabled:Boolean

A Boolean value that specifies whether a button is enabled.

 

filters:Array

An indexed array containing each filter object currently associated with the button.

 

_focusrect:Boolean

A Boolean value that specifies whether a button has a yellow rectangle around it when it has keyboard 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.

 

menu:ContextMenu

Associates the ContextMenu object contextMenu with the button object my_button.

 

_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.

 

scale9Grid:Rectangle

The rectangular region that defines the nine scaling regions for the button.

 

_soundbuftime:Number

The property that 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 mouse release events.

 

_url:String [read-only]

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

 

useHandCursor:Boolean

A Boolean value that, when set to true (the default), indicates whether a pointing hand (hand cursor) displays when the mouse rolls over a 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 coordinate of the mouse position 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]

Indicates 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 mouse button is clicked over the button and the pointer then dragged outside of the button.

onDragOver = function() {}

Invoked when the user presses and drags the mouse button outside and then 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 while the pointer is outside the button after the button is pressed while the pointer is inside the button.

onRollOut = function() {}

Invoked when the pointer moves outside a button area.

onRollOver = function() {}

Invoked when the pointer moves over a button area.

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)



Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001436.html