| Package | flare.animate.interpolate |
| Class | public class Interpolator |
| Subclasses | ArrayInterpolator, ColorInterpolator, DateInterpolator, MatrixInterpolator, NumberInterpolator, ObjectInterpolator, PointInterpolator, RectangleInterpolator |
create method for details about interpolator creation.
| Property | Defined by | ||
|---|---|---|---|
| _prop : Property
The property to interpolate.
| Interpolator | ||
| _target : Object The target object whose property is being interpolated.
| Interpolator | ||
| Method | Defined by | ||
|---|---|---|---|
|
Interpolator(target:Object, property:String, start:Object, end:Object)
Base constructor for Interpolator instances.
| Interpolator | ||
|
addInterpolatorRule(f:Function):void
[static]
Adds a rule to the interpolator factory.
| Interpolator | ||
|
addInterpolatorType(valueType:String, interpType:String):void
[static]
Extends the interpolator factory with a new interpolator type.
| Interpolator | ||
|
clearInterpolatorRules():void
[static]
Clears all interpolator rule functions from the interpolator
factory.
| Interpolator | ||
|
clearInterpolatorTypes():void
[static]
Clears the lookup table of interpolator types, removing all
type to interpolator mappings.
| Interpolator | ||
|
create(target:Object, property:String, start:Object, end:Object):Interpolator
[static]
Returns a new interpolator instance for the given target object,
property name, and interpolation target value.
| Interpolator | ||
|
interpolate(f:Number):void
Calculate and set an interpolated property value.
| Interpolator | ||
|
reclaim(interp:Interpolator):void
[static]
Reclaims an interpolator for later recycling.
| Interpolator | ||
|
reset(target:Object, property:String, start:Object, end:Object):void
Re-initializes an exising interpolator instance.
| Interpolator | ||
| Method | Defined by | ||
|---|---|---|---|
|
init(start:Object, end:Object):void
Performs initialization of an interpolator, typically by
initializing the start and ending values.
| Interpolator | ||
| _prop | property |
protected var _prop:PropertyThe property to interpolate.
| _target | property |
protected var _target:ObjectThe target object whose property is being interpolated.
| Interpolator | () | constructor |
public function Interpolator(target:Object, property:String, start:Object, end:Object)Base constructor for Interpolator instances.
Parameterstarget:Object — the object whose property is being interpolated
|
|
property:String — the property to interpolate
|
|
start:Object — the target value of the interpolation
|
|
end:Object |
| addInterpolatorRule | () | method |
public static function addInterpolatorRule(f:Function):voidAdds a rule to the interpolator factory. The input function should take 4 arguments -- a target object, property name string, a starting value, and a target value -- and either return a fully qualified class name for the type of interpolator to use, or null if this rule does not apply.
Parametersf:Function — the rule function for supplying custom interpolator types
based on contextual conditions
|
| addInterpolatorType | () | method |
public static function addInterpolatorType(valueType:String, interpType:String):voidExtends the interpolator factory with a new interpolator type.
ParametersvalueType:String — the fully qualified class name for the object type
to interpolate
|
|
interpType:String — the fully qualified class name for the
interpolator class type
|
| clearInterpolatorRules | () | method |
public static function clearInterpolatorRules():voidClears all interpolator rule functions from the interpolator factory.
| clearInterpolatorTypes | () | method |
public static function clearInterpolatorTypes():voidClears the lookup table of interpolator types, removing all type to interpolator mappings.
| create | () | method |
public static function create(target:Object, property:String, start:Object, end:Object):InterpolatorReturns a new interpolator instance for the given target object, property name, and interpolation target value. This factory method follows these steps to provide an interpolator instance:
By default, the interpolator factory contains two rules. The first rule returns the class name of ColorInterpolator for any property names containing the string "color" or "Color". The second rule returns the class name of ObjectInterpolator for the property name "shape".
The default value type to interpolator type mappings are:
Number -> NumberInterpolatorint -> NumberInterpolatorDate -> DateInterpolatorArray -> ArrayInterpolatorflash.geom.Point -> PointInterpolatorflash.geom.Rectangle -> RectangleInterpolatorThe interpolator factory can be extended either by adding new interpolation rule functions or by adding new mappings from interpolation value types to custom interpolator classes.
Parameterstarget:Object |
|
property:String |
|
start:Object |
|
end:Object |
Interpolator |
| init | () | method |
protected function init(start:Object, end:Object):voidPerforms initialization of an interpolator, typically by initializing the start and ending values. Subclasses should override this method for custom initialization.
Parametersstart:Object — the target value of the interpolation
|
|
end:Object |
| interpolate | () | method |
public function interpolate(f:Number):voidCalculate and set an interpolated property value. Subclasses should override this method to implement custom interpolation routines.
Parametersf:Number — the interpolation fraction (typically between 0 and 1)
|
| reclaim | () | method |
public static function reclaim(interp:Interpolator):voidReclaims an interpolator for later recycling. The reclaimed interpolator should not be in active use by any other classes.
Parametersinterp:Interpolator — the Interpolator to reclaim
|
| reset | () | method |
public function reset(target:Object, property:String, start:Object, end:Object):voidRe-initializes an exising interpolator instance.
Parameterstarget:Object — the object whose property is being interpolated
|
|
property:String — the property to interpolate
|
|
start:Object — the target value of the interpolation
|
|
end:Object |