spark.effects.interpolation

# MultiValueInterpolator - AS3 Flex

Package | spark.effects.interpolation
Class | public class MultiValueInterpolator
Inheritance | MultiValueInterpolator Object
Implements | IInterpolator

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

The MultiValueInterpolator class interpolates each element of Arrays or Vectors of start and end elements separately, using another interpolator to do the interpolation for each element. By default, the interpolation for each element uses the NumberInterpolator class, but you can construct a MultiValueInterpolator instance with a different interpolator.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | elementInterpolator : IInterpolator The interpolator for each element of the input Array or Vector. | MultiValueInterpolator

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | MultiValueInterpolator(elementInterpolator:IInterpolator = null) Constructor. | MultiValueInterpolator
|  | decrement(baseValue:Object, decrementValue:Object):Object Given a base value and a value to subtract from it, return the result of that decrement operation. | MultiValueInterpolator
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | increment(baseValue:Object, incrementValue:Object):Object Given a base value and a value to add to it, return the result of that operation. | MultiValueInterpolator
|  | 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. | MultiValueInterpolator
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### elementInterpolator

property

`elementInterpolator:IInterpolator`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

The interpolator for each element of the input Array or Vector. A value of null specifies to use the NumberInterpolator class.

The default value is `NumberInterpolator.`

Implementation
`public function get elementInterpolator():IInterpolator`
`public function set elementInterpolator(value:IInterpolator):void`
Constructor Detail

### MultiValueInterpolator

()
Constructor

`public function MultiValueInterpolator(elementInterpolator:IInterpolator = null)`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Constructor.

Parameters

| `elementInterpolator:IInterpolator` (default = `null`)`` — The interpolator for each element of the Array. If no interpolator is specified, use the NumberInterpolator class.

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. Interpolation for MultiValueInterpolator consists of running a separate interpolation on each element of the startValue and endValue arrays or vectors, returning a new Array or Vector that holds those interpolated values. The returned object will be an Array if startValue and endValue are of type Array, otherwise the returned object will be of type Vector.

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.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00