Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
spark.effects.interpolation 
IInterpolator 
Packagespark.effects.interpolation
Interfacepublic interface IInterpolator
Implementors HSBInterpolator, MultiValueInterpolator, NumberInterpolator, RGBInterpolator

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The IInterpolator interface is implemented by classes that calculate values for the Animation class. The Animation class can handle parametric interpolation between Number values and arrays of Number values, but it cannot handle different types of interpolation, or interpolation between different types of values. Implementors of this interface can provide arbitrary interpolation capabilities so that Animations can be created between arbitrary values.



Public Methods
 MethodDefined By
  
decrement(baseValue:Object, decrementValue:Object):Object
Given a base value and a value to subtract from it, return the result of that decrement operation.
IInterpolator
  
increment(baseValue:Object, incrementValue:Object):Object
Given a base value and a value to add to it, return the result of that operation.
IInterpolator
  
interpolate(fraction:Number, startValue:Object, endValue:Object):Object
Given an elapsed fraction of an animation, between 0.0 and 1.0, and start and end values to interpolate, return the interpolated value.
IInterpolator
Method Detail

decrement

()method
public function decrement(baseValue:Object, decrementValue:Object):Object

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Given a base value and a value to subtract from it, return the result of that decrement operation. For example, if the objects are simple Numbers, the result would be Number(baseValue) - Number(incrementValue). This function is called by the animation system when it needs to dynamically calculate a value given some ending value and a 'by' value that should be subtracted from it. Both of the arguments are of type Object and cannot simply be added together.

Parameters

baseValue:Object — The start value of the interpolation.
 
decrementValue:Object — The change to apply to the baseValue.

Returns
Object — The interpolated value.

increment

()method 
public function increment(baseValue:Object, incrementValue:Object):Object

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Given a base value and a value to add to it, return the result of that operation. For example, if the objects are simple Numbers, the result is a Number(baseValue) + Number(incrementValue). This method is called by the animation system when it needs to dynamically calculate a value given some starting value and a 'by' value that should be added to it. Both of the arguments are of type Object and cannot simply be added together.

Parameters

baseValue:Object — The start value of the interpolation.
 
incrementValue:Object — The change to apply to the baseValue.

Returns
Object — The interpolated value.

interpolate

()method 
public function interpolate(fraction:Number, startValue:Object, endValue:Object):Object

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Given an elapsed fraction of an animation, between 0.0 and 1.0, and start and end values to interpolate, return the interpolated value.

Parameters

fraction:Number — The fraction elapsed of the animation, between 0.0 and 1.0.
 
startValue:Object — The start value of the interpolation.
 
endValue:Object — The end value of the interpolation.

Returns
Object — The interpolated value.