Package | org.axiis.states |
Class | public class State |
Inheritance | State ![]() |
<axiis:State id="myState"
enterStateEvent="mouseOver"
exitStateEvent="mouseOut"
targets="{[myTarget1,myTarget1,myTarget2]}"
properties="{['width','height','radius']}"
values="{[w,h,r]}" />
indicates that myTarget1.width
and myTarget1.height
should be set to w
and h
, respectively and
myTarget2.radius
should be set to r
when the
owner of this state is moused over. These values should be unset when
the mouse is moved off of the owner.
Within Axiis, an Array of States can be set to any Layout's states
property. As Layouts create children, each child sets up listeners on
itself for the Layout's states' enterStateEvent
and
exitStateEvent
events. When those events are triggered, the
relevant state's apply and remove methods are called, respectively. This
is usually used to modify the drawingGeometry
of the Layout.
Property | Defined By | ||
---|---|---|---|
enabled : Boolean = true | State | ||
enterStateEvent : String
The eventType of the Event indicating that this state should be
activated. | State | ||
exitStateEvent : String
The eventType of the Event indicating that this state should be
removed. | State | ||
propagateToAncestors : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of
its AxiisSprite ancestors should enter the state as well. | State | ||
propagateToAncestorsSiblings : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of
its AxiisSprite ancestors and their children should enter the state
as well. | State | ||
propagateToDescendents : Boolean = true
A flag indicating that when an AxiisSprite enters this state all of
its descendents should enter the state as well. | State | ||
propagateToSiblings : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of
its siblings should enter the state as well. | State | ||
properties : Array
An Array of Strings that define the properties on the corresponding
Objects in the targets Array that should be modified. | State | ||
targets : Array
An Array of Objects that should have one or more of their properties
modified by this state. | State | ||
values : Array
An Array containing the values that the corresponding target's
properties should be set to when this State is applied. | State |
Method | Defined By | ||
---|---|---|---|
State()
Constructor. | State | ||
apply():void
Modifies each Object at index i in the targets Array
by setting its corresponding property, properties[i],
to value[i]. | State | ||
remove():void
Returns the targets' properties to their original values, undoing the
effects of the previous call to apply. | State |
enabled | property |
public var enabled:Boolean = true
enterStateEvent | property |
public var enterStateEvent:String
The eventType of the Event indicating that this state should be activated.
exitStateEvent | property |
public var exitStateEvent:String
The eventType of the Event indicating that this state should be removed.
propagateToAncestors | property |
public var propagateToAncestors:Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors should enter the state as well.
propagateToAncestorsSiblings | property |
public var propagateToAncestorsSiblings:Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors and their children should enter the state as well.
propagateToDescendents | property |
public var propagateToDescendents:Boolean = true
A flag indicating that when an AxiisSprite enters this state all of its descendents should enter the state as well.
propagateToSiblings | property |
public var propagateToSiblings:Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its siblings should enter the state as well.
properties | property |
public var properties:Array
An Array of Strings that define the properties on the corresponding Objects in the targets Array that should be modified.
targets | property |
public var targets:Array
An Array of Objects that should have one or more of their properties modified by this state.
values | property |
public var values:Array
An Array containing the values that the corresponding target's properties should be set to when this State is applied.
State | () | Constructor |
public function State()
Constructor.
apply | () | method |
public function apply():void
Modifies each Object at index i
in the targets Array
by setting its corresponding property, properties[i],
to value[i].
In pseudo-code, this amounts to targets[i][properties[i]] = values[i];
for all i
.
remove | () | method |
public function remove():void
Returns the targets' properties to their original values, undoing the effects of the previous call to apply.