A button with audio events for click and over mouse events
springroll.easeljs.SoundButton
imageSettings
[label=null]
[enabled=true]
[clickAlias="ButtonClick"]
[overAlias="ButtonRollover"]
imageSettings
DOMElement | Object
The loaded image element, see springroll.easeljs.Button constructor
[label=null]
Object
optional
See springroll.easeljs.Button constructor
[enabled=true]
Boolean
optional
If the button should be enabled by default
[clickAlias="ButtonClick"]
String
optional
The button click audio alias
[overAlias="ButtonRollover"]
String
optional
The button rollover audio alias
_addProperty
propertyName
Adds a property to the button. Setting the property sets the value in _stateFlags and calls _updateState().
propertyName
String
The property name to add to the button.
_onClick
The callback for when the button the button is clicked or tapped on. This is the most reliable way of detecting mouse up/touch end events that are on this button while letting the pressup event handle the mouse up/touch ends on and outside the button.
_onMouseUp
The callback for when the button for when the mouse/touch is released on the button
_updateState
Updates back based on the current button state.
The state data for the active button state, so that subclasses can use the value picked by this function without needing to calculate it themselves.
cacheByBounds
[buffer=0]
[scale=1]
Does a cache by the nominalBounds set from Flash
[buffer=0]
Int
optional
The space around the nominal bounds to include in cache image
[scale=1]
Number
optional
The scale to cache the container by.
cacheByRect
rect
[buffer=0]
[scale=1]
Does a cache by a given rectangle
rect
createjs.Rectangle
The rectangle to cache with.
[buffer=0]
Int
optional
Additional space around the rectangle to include in cache image
[scale=1]
Number
optional
The scale to cache the container by.
setText
text
Sets the text of the label. This does nothing if the button was not initialized with a label.
text
String
The text to set the label to.
_height
The height of the button art, independent of the scaling of the button itself.
_offset
An offset to button positioning, generally used to adjust for a highlight around the button.
_stateData
A dictionary of state graphic data, keyed by state name. Each object contains the sourceRect (src) and optionally 'trim', another Rectangle. Additionally, each object will contain a 'label' object if the button has a text label.
_statePriority
An array of state names (Strings), in their order of priority. The standard order previously was ["highlighted", "disabled", "down", "over", "selected", "up"].
height
The height of the button, based on the height of back. This value is affected by scale.