Packagecom.brightcove.api.components
Classpublic class Button
InheritanceButton Inheritance UIObject Inheritance Component Inheritance flash.events.EventDispatcher
Subclasses ToggleButton

The Button UI component in the player.



Public Properties
 PropertyDefined By
 Inheritedcomponent : Object
[read-only] Returns a reference to the wrapped API element in the player, which can be used to get access to new methods that might not be defined within this version of the SWC.
Component
Public Methods
 MethodDefined By
  
Button(element:Object)
Constructor.
Button
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
[override] Adds a listener for an event.
UIObject
 Inherited
getAlpha():Number
Returns the alpha value of the component.
Component
  
getAutoSize():Boolean
Returns whether the label resizes based on its text.
Button
 Inherited
getBlendMode():String
Returns the blend mode of the component.
UIObject
 Inherited
Returns the interface for the layout container of the element.
Component
 Inherited
getCSS():String
Returns the CSS used for this component instance.
UIObject
 Inherited
getDefinition():String
Returns the XML (BEML) definition of the component.
Component
 Inherited
getEnabled():Boolean
Returns whether component is enabled.
UIObject
  
getFont():String
Returns the name of the font used for the label.
Button
 Inherited
getHeight():Number
Returns the pixel height of the component.
Component
  
Returns the horizontal alignment for the icon.
Button
  
Returns the vertical alignment for the icon.
Button
  
getIconName():String
Returns the name of the current icon displayed.
Button
  
Returns the pixel amount on the x axis the icon is offset from its aligned position.
Button
  
Returns the pixel amount on the y axis the icon is offset from its aligned position.
Button
  
getIconScale():Number
Returns the percent scale at which to render the icon.
Button
 Inherited
getID():String
Returns the ID of the component, as defined in the XML.
Component
 Inherited
Returns whether the component is included in layout calculations and rendering in parent layout box.
Component
 Inherited
getIndex():int
Returns the index of this element in its parent's elements array.
Component
  
getIsTruncated():Boolean
Returns whether the label is currently truncated.
Button
  
getLabel():String
Returns the current text in the label.
Button
  
Returns the horizontal alignment for the label.
Button
  
Returns the vertical alignment for the label.
Button
  
Returns the minimum pixel amount to the left and right of the label.
Button
  
Returns the pixel amount on the x axis the label is offset from its aligned position.
Button
  
Returns the pixel amount on the y axis the label is offset from its aligned position.
Button
  
getLabelSize():Number
Returns the font point size used for the label.
Button
  
getLabelWidth():Number
Returns the current width of the label.
Button
  
getMultiline():Boolean
Returns whether the label is set to be multiline.
Button
 Inherited
Returns the interface for the layout element that is the next sibling to this element in the parent containers's element array.
Component
 Inherited
getNodeName():String
Returns the node name of the element.
Component
 Inherited
Returns the interface for the layout element that is the previous sibling to this element in the parent containers's element array.
Component
 Inherited
getRotation():Number
Returns the rotation of the component.
UIObject
  
getShowBack():Boolean
Returns whether the background graphic for the button should be shown (if any is assigned through the theme).
Button
  
getTooltip():String
Returns the tooltip, if any, applied to the component.
Button
  
Returns whether the label is set to truncate its text if the label is larger than the button size.
Button
 Inherited
getVisible():Boolean
Returns whether the component is visible.
Component
 Inherited
getWidth():Number
Returns the pixel width of the component.
Component
 Inherited
getX(global:Boolean = false):Number
Returns the position of the component on the x axis.
Component
 Inherited
getY(global:Boolean = false):Number
Returns the position of the component on the y axis.
Component
 Inherited
move(x:Number, y:Number, global:Boolean = false):void
Sets the x,y coordinates of the component.
Component
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] Removes a listener for an event.
UIObject
 Inherited
setAlpha(alpha:Number):void
Sets the alpha value of the component.
Component
  
setAutoSize(autoSize:Boolean):void
Sets whether the label should resize based on its text.
Button
 Inherited
setBlendMode(mode:String):void
Sets the blend mode of the component.
UIObject
 Inherited
setEnabled(enable:Boolean):void
Enables/disables component for events.
UIObject
  
setFont(font:String):void
Sets a font to be used instead of the style format's.
Button
  
setIconAlignmentH(alignment:String):void
Sets the horizontal alignment for the icon.
Button
  
setIconAlignmentV(alignment:String):void
Sets the vertical alignment for the icon.
Button
  
setIconName(name:String):void
Sets the current icon displayed.
Button
  
setIconOffsetX(offset:Number):void
Sets the pixel amount on the x axis the icon should be offset from its aligned position.
Button
  
setIconOffsetY(offset:Number):void
Sets the pixel amount on the y axis the icon should be offset from its aligned position.
Button
  
setIconScale(scale:Number):void
Sets the percent scale at which to render the icon.
Button
 Inherited
setIncludeInLayout(includeInLayout:Boolean):void
Sets whether the component is included in layout calculations and rendering in parent layout box.
Component
  
setLabel(label:String):void
Sets the current text for the label.
Button
  
setLabelAlignmentH(alignment:String):void
Sets the horizontal alignment for the label.
Button
  
setLabelAlignmentV(alignment:String):void
Sets the vertical alignment for the label.
Button
  
setLabelBuffer(buffer:Number):void
Sets the minimum pixel amount to the left and right of the label.
Button
  
setLabelOffsetX(offset:Number):void
Sets the pixel amount on the x axis the label should be offset from its aligned position.
Button
  
setLabelOffsetY(offset:Number):void
Sets the pixel amount on the y axis the label should be offset from its aligned position.
Button
  
setLabelSize(size:Number):void
Sets a font size to be used instead of the style format's.
Button
  
setMultiline(multiline:Boolean):void
Sets whether the label should display multiline.
Button
 Inherited
setRotation(rotation:Number):void
Sets the rotation of the component.
UIObject
  
setShowBack(show:Boolean):void
Sets whether the background graphic for the button should be shown (if any is assigned through the theme).
Button
 Inherited
setSize(width:Number, height:Number):void
Sets the pixel dimensions for the wrapped component.
Component
 Inherited
setStyles(styles:String):void
Overrides specific styles for a component by accepting a semicolon-delimited list of style names and colors.
UIObject
  
setTooltip(toolTip:String):void
Sets the tooltip for the component.
Button
  
setTruncateLabel(truncate:Boolean):void
Sets whether the label should truncate its text if the label is larger than the button size.
Button
 Inherited
setVisible(visible:Boolean):void
Sets whether the component is visible.
Component
Protected Methods
 MethodDefined By
 Inherited
redispatchEvent(event:Event):void
Sends the specified event, usually sent from a handler in order to bubble up non-bubbling events.
UIObject
Events
 Event Summary Defined By
 InheritedDispatched when a UI element in the player is clicked.Component
 InheritedDispatched when a UI element in the player is rolled off.Component
 InheritedDispatched when a UI element in the player is rolled over.Component
 InheritedDispatched when a property changes in a bindable component.Component
Constructor Detail
Button()Constructor
public function Button(element:Object)

Constructor.

Parameters
element:Object — layout element to wrap and delegate all calls to.
Method Detail
getAutoSize()method
public function getAutoSize():Boolean

Returns whether the label resizes based on its text.

Returns
Boolean — True if the label resizes based on its text.
getFont()method 
public function getFont():String

Returns the name of the font used for the label.

Returns
String — The name of the font used.
getIconAlignmentH()method 
public function getIconAlignmentH():String

Returns the horizontal alignment for the icon.

Returns
String — The horizontal alignment setting for the button icon.
getIconAlignmentV()method 
public function getIconAlignmentV():String

Returns the vertical alignment for the icon.

Returns
String — The vertical alignment setting for the button icon.
getIconName()method 
public function getIconName():String

Returns the name of the current icon displayed.

Returns
String — The name of the current icon displayed.
getIconOffsetX()method 
public function getIconOffsetX():Number

Returns the pixel amount on the x axis the icon is offset from its aligned position.

Returns
Number — The pixel amount on the x axis the icon is offset from its aligned position.
getIconOffsetY()method 
public function getIconOffsetY():Number

Returns the pixel amount on the y axis the icon is offset from its aligned position.

Returns
Number — The pixel amount on the y axis the icon is offset from its aligned position.
getIconScale()method 
public function getIconScale():Number

Returns the percent scale at which to render the icon.

Returns
Number — The percent scale at which to render the icon.
getIsTruncated()method 
public function getIsTruncated():Boolean

Returns whether the label is currently truncated.

Returns
Boolean — True if the label is currently truncated.
getLabel()method 
public function getLabel():String

Returns the current text in the label.

Returns
String — The current text in the label.
getLabelAlignmentH()method 
public function getLabelAlignmentH():String

Returns the horizontal alignment for the label.

Returns
String — The horizontal alignment setting for the button label.
getLabelAlignmentV()method 
public function getLabelAlignmentV():String

Returns the vertical alignment for the label.

Returns
String — The vertical alignment setting for the button label.
getLabelBuffer()method 
public function getLabelBuffer():Number

Returns the minimum pixel amount to the left and right of the label.

Returns
Number — The pixel amount used as a visual buffer to the left and right of the label.
getLabelOffsetX()method 
public function getLabelOffsetX():Number

Returns the pixel amount on the x axis the label is offset from its aligned position.

Returns
Number — The pixel amount on the x axis the label is offset from its aligned position.
getLabelOffsetY()method 
public function getLabelOffsetY():Number

Returns the pixel amount on the y axis the label is offset from its aligned position.

Returns
Number — The pixel amount on the y axis the label is offset from its aligned position.
getLabelSize()method 
public function getLabelSize():Number

Returns the font point size used for the label.

Returns
Number — The point size of the font.
getLabelWidth()method 
public function getLabelWidth():Number

Returns the current width of the label.

Returns
Number — The pixel width of the label.
getMultiline()method 
public function getMultiline():Boolean

Returns whether the label is set to be multiline.

Returns
Boolean — True if the label is multiline.
getShowBack()method 
public function getShowBack():Boolean

Returns whether the background graphic for the button should be shown (if any is assigned through the theme).

Returns
Boolean — False if the background graphic is not to be shown.
getTooltip()method 
public function getTooltip():String

Returns the tooltip, if any, applied to the component.

Returns
String — Returns the string tooltip text.
getTruncateLabel()method 
public function getTruncateLabel():Boolean

Returns whether the label is set to truncate its text if the label is larger than the button size.

Returns
Boolean — True if the label will truncate text based on the button size.
setAutoSize()method 
public function setAutoSize(autoSize:Boolean):void

Sets whether the label should resize based on its text.

Parameters

autoSize:Boolean — if the label should resize based on its text.

setFont()method 
public function setFont(font:String):void

Sets a font to be used instead of the style format's.

Parameters

font:String — name of the font to use -- MUST be embedded, if the style format embeds the font.

setIconAlignmentH()method 
public function setIconAlignmentH(alignment:String):void

Sets the horizontal alignment for the icon.

Parameters

alignment:String — horizontal alignment setting for the button icon.

setIconAlignmentV()method 
public function setIconAlignmentV(alignment:String):void

Sets the vertical alignment for the icon.

Parameters

alignment:String — vertical alignment setting for the button icon.

setIconName()method 
public function setIconName(name:String):void

Sets the current icon displayed.

Parameters

name:String — name of the current icon to display.

setIconOffsetX()method 
public function setIconOffsetX(offset:Number):void

Sets the pixel amount on the x axis the icon should be offset from its aligned position.

Parameters

offset:Number — pixel amount on the x axis the icon should offset from its aligned position.

setIconOffsetY()method 
public function setIconOffsetY(offset:Number):void

Sets the pixel amount on the y axis the icon should be offset from its aligned position.

Parameters

offset:Number — pixel amount on the y axis the icon should offset from its aligned position.

setIconScale()method 
public function setIconScale(scale:Number):void

Sets the percent scale at which to render the icon.

Parameters

scale:Number — percent scale at which to render the icon.

setLabel()method 
public function setLabel(label:String):void

Sets the current text for the label.

Parameters

label:String — text to apply to the label.

setLabelAlignmentH()method 
public function setLabelAlignmentH(alignment:String):void

Sets the horizontal alignment for the label.

Parameters

alignment:String — horizontal alignment setting for the button label.

setLabelAlignmentV()method 
public function setLabelAlignmentV(alignment:String):void

Sets the vertical alignment for the label.

Parameters

alignment:String — vertical alignment setting for the button label.

setLabelBuffer()method 
public function setLabelBuffer(buffer:Number):void

Sets the minimum pixel amount to the left and right of the label.

Parameters

buffer:Number — pixel amount to be used as a visual buffer to the left and right of the label.

setLabelOffsetX()method 
public function setLabelOffsetX(offset:Number):void

Sets the pixel amount on the x axis the label should be offset from its aligned position.

Parameters

offset:Number — pixel amount on the x axis the label should offset from its aligned position.

setLabelOffsetY()method 
public function setLabelOffsetY(offset:Number):void

Sets the pixel amount on the y axis the label should be offset from its aligned position.

Parameters

offset:Number — pixel amount on the y axis the label should offset from its aligned position.

setLabelSize()method 
public function setLabelSize(size:Number):void

Sets a font size to be used instead of the style format's.

Parameters

size:Number — point size of the font.

setMultiline()method 
public function setMultiline(multiline:Boolean):void

Sets whether the label should display multiline.

Parameters

multiline:Boolean — if the label should display as multiline.

setShowBack()method 
public function setShowBack(show:Boolean):void

Sets whether the background graphic for the button should be shown (if any is assigned through the theme).

Parameters

show:Boolean — if the background graphic is not to be shown.

setTooltip()method 
public function setTooltip(toolTip:String):void

Sets the tooltip for the component.

Parameters

toolTip:String — string to use for the tooltip text.

setTruncateLabel()method 
public function setTruncateLabel(truncate:Boolean):void

Sets whether the label should truncate its text if the label is larger than the button size.

Parameters

truncate:Boolean — if the label should truncate text based on the button size.