Package | org.axiis.layouts.utils |
Class | public class PropertyModifier |
Inheritance | PropertyModifier ![]() |
Property | Defined By | ||
---|---|---|---|
iteration : Number [read-only]
The current iteration of an active modification. | PropertyModifier | ||
modifier : Object
The modification to apply to the property each time apply
is called. | PropertyModifier | ||
modifierOperator : String
How to apply the modifier for each iteration. | PropertyModifier | ||
property : String
The property that should be modified as this PropertyModifier is
applied. | PropertyModifier |
Method | Defined By | ||
---|---|---|---|
Constructor. | PropertyModifier | ||
apply():void
Applies the modifier to the modifyOperator
and sets the target property to the result. | PropertyModifier | ||
beginModify(target:Object):void
Indicates that the PropertyModifier should operate on the
target. | PropertyModifier | ||
end():void
Ends the modification process and returns the target property to its
original value. | PropertyModifier |
iteration | property |
iteration:Number
[read-only]
The current iteration of an active modification. This is the number of
times apply
has been called since a call to
beginModify
. If the PropertyModifier has not been started
or has ended, the value of this property is -1.
public function get iteration():Number
modifier | property |
public var modifier:Object
The modification to apply to the property each time apply
is called. This property can be a Number, a Function, or an Array of
Numbers.
apply
is called.apply
is called and sets the property to the return
value of the function. The function takes two arguments, the
current iteration as of the PropertyModifier and the current value
of the property.iteration % arr.length
where arr is the array.modifierOperator | property |
modifierOperator:String
[read-write]
How to apply the modifier for each iteration. Accepted values are
"add", "subtract", "multiply", "divide", and "none". When
modifierOperator
is one of the four arithmetic opertors
the respective operator from {+=, -=,
*=, /=} is applied to the property's
current value each time apply
is called.
For example, if modifierOperator
is "subtract",
modifier
is 100, and the property is 1000,
the property will be changed to 900, 800,
and 700 over the course of 3 calls to apply
.
modifierOperator
is "none" the target property will
be assigned to the modifier
each time apply
is called. This behavior is ideal when used in conjuction with a
function call used as a modifier
.
This property can be used as the source for data binding.
public function get modifierOperator():String
public function set modifierOperator(value:String):void
property | property |
public var property:String
The property that should be modified as this PropertyModifier is applied. If you wanted to modify the x position of a Geometry, you would set the property to "x", for example.
PropertyModifier | () | Constructor |
public function PropertyModifier()
Constructor.
apply | () | method |
public function apply():void
Applies the modifier
to the modifyOperator
and sets the target property to the result. Increments the iteration
by 1 each time this method is called. See the documentation for
modifier
and modifyOperator
for details.
beginModify | () | method |
public function beginModify(target:Object):void
Indicates that the PropertyModifier should operate on the
target
.
Parameters
target:Object — The object that should have its property modified
by this PropertyModifier.
|
end | () | method |
public function end():void
Ends the modification process and returns the target property to its original value.