Packageardisia.components.iconButton
Classpublic class IconButton
InheritanceIconButton Inheritance spark.components.Button

A icon button designed to display its label using a flyout animation.

View the technical documentation on the Ardisia Labs website for more information.

Default MXML Propertylabel



Public Properties
 PropertyDefined By
  duration : Number = 150
The duration of the flyout effect in milliseconds.
IconButton
  flyoutDirection : String = right
The position of the flyout label relative to the button when it is displayed.
IconButton
  flyoutDistance : Number = 20
Sets the number of pixels for the flyout label to animate.
IconButton
  showFlyoutLabel : Boolean = true
True to display the flyout label.
IconButton
Public Methods
 MethodDefined By
  
IconButton
  
Call to immediately remove the flyout label.
IconButton
Protected Methods
 MethodDefined By
  
Displays the label by animating it initially from a position adjacent to the button to its final position, as determined by the "flyoutDistance" property.
IconButton
  
eventHandler(event:Event):void
Handles event on the component.
IconButton
  
getFlyoutPositions(direction:String = null):Array
Return the coordinates for the flyout move effect.
IconButton
  
hideAnimationHandler(event:EffectEvent):void
After the animation ends, fires the "labelHide" event and removes the label.
IconButton
  
hideLabel():void
Hides the label by animating it initially from its current position to a position adjacent to the button.
IconButton
  
willOverflow(xTo:Number, yTo:Number):Boolean
Check if the proposed xTo and yTo will cause the flyout label to overflow the screen bounds.
IconButton
Events
 Event Summary Defined By
  Dispatched when the flyout label has finished animating out and has been removed.IconButton
  Dispatched when the flyout label has finished animating in and is displayed.IconButton
Styles
 Style Description Defined By
  
flyoutBackgroundAlpha
Type: Number CSS Inheritance: no
The alpha applied to the background of the flyout label. The default value is 1.
IconButton
  
flyoutBackgroundColor
Type: uint Format: Color CSS Inheritance: no
The color applied to the background of the flyout label. The default value is #FFFFFF.
IconButton
  
flyoutColor
Type: uint Format: Color CSS Inheritance: no
The color applied to the flyout label color. The default value is #000000.
IconButton
  
iconOffsetX
Type: Number CSS Inheritance: no
Icon offset along the x axis. The default value is 0.
IconButton
  
iconOffsetY
Type: Number CSS Inheritance: no
Icon offset along the y axis. The default value is 0.
IconButton
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
flyoutLabelFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
The factory that creates the flyout label.

The IFactory must return an object of type DataRenderer
IconButton
Property Detail
durationproperty
public var duration:Number = 150

The duration of the flyout effect in milliseconds.

Set to zero to skip the flyout animation.

The default value is 150.

flyoutDirectionproperty 
public var flyoutDirection:String = right

The position of the flyout label relative to the button when it is displayed.

The default value is "right".

flyoutDistanceproperty 
public var flyoutDistance:Number = 20

Sets the number of pixels for the flyout label to animate.

Set to zero to align the label adjacent to the button and skip the flyout animation.

The default value is 20.

showFlyoutLabelproperty 
public var showFlyoutLabel:Boolean = true

True to display the flyout label.

The default value is true.

Constructor Detail
IconButton()Constructor
public function IconButton()



Method Detail
displayLabel()method
protected function displayLabel():void

Displays the label by animating it initially from a position adjacent to the button to its final position, as determined by the "flyoutDistance" property.

eventHandler()method 
protected function eventHandler(event:Event):void

Handles event on the component.

Parameters

event:Event — Event

getFlyoutPositions()method 
protected function getFlyoutPositions(direction:String = null):Array

Return the coordinates for the flyout move effect.

Parameters

direction:String (default = null) — a string for the direction of the flyout effect

Returns
Array — [xFrom, xTo, yFrom, yTo]
hideAnimationHandler()method 
protected function hideAnimationHandler(event:EffectEvent):void

After the animation ends, fires the "labelHide" event and removes the label.

Parameters

event:EffectEvent — the EffectEvent that triggered the handler

hideLabel()method 
protected function hideLabel():void

Hides the label by animating it initially from its current position to a position adjacent to the button.

removeFlyoutLabel()method 
public function removeFlyoutLabel():void

Call to immediately remove the flyout label.

willOverflow()method 
protected function willOverflow(xTo:Number, yTo:Number):Boolean

Check if the proposed xTo and yTo will cause the flyout label to overflow the screen bounds.

Parameters

xTo:Number — the proposed x coordinate
 
yTo:Number — the proposed y coordinate

Returns
Boolean — Boolean
Event Detail
flyoutHide Event
Event Object Type: ardisia.components.iconButton.events.IconButtonEvent
IconButtonEvent.type property = ardisia.components.flyoutButton.events.FlyoutButtonEvent

Dispatched when the flyout label has finished animating out and has been removed.

flyoutShow Event  
Event Object Type: ardisia.components.iconButton.events.IconButtonEvent
IconButtonEvent.type property = ardisia.components.flyoutButton.events.FlyoutButtonEvent

Dispatched when the flyout label has finished animating in and is displayed.