fl.motion

# CustomEase - AS3 Flash

Package | fl.motion
Class | public class CustomEase
Inheritance | CustomEase Object
Implements | ITween

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The CustomEase class is used to modify specific properties of the easing behavior of a motion tween as the tween progresses over time. A custom easing curve is composed of one or more cubic Bezier curves. You can apply the custom easing curve to all properties at once, or you can define different curves for different properties.

The implementation of this class parallels the Flash CS4 Custom Ease In/Ease Out dialog box. Flash CS4 displays a graph in the Custom Ease In/Ease Out dialog box representing the degree of motion over time. The horizontal axis represents frames, and the vertical axis represents the percent of change of a property through the progression of the tween. The first keyframe is represented as 0%, and the last keyframe is represented as 100%. The slope of the graph's curve represents the rate of change of the object. When the curve is `horizontal` (no slope), the velocity is zero; when the curve is `vertical`, an instantaneous rate of change occurs.

Default MXML Property `points`

Related API Elements

Motion XML Elements

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
|  | points : Array An ordered collection of points in the custom easing curve. | CustomEase
|  | target : String The name of the animation property to target. | CustomEase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | CustomEase(xml:XML = null) Constructor for CustomEase instances. | CustomEase
|  | getValue(time:Number, begin:Number, change:Number, duration:Number):Number Calculates an interpolated value for a numerical property of animation, using a custom easing curve. | CustomEase
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | 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

### points

property

`public var points:Array`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

An ordered collection of points in the custom easing curve. Each item in the array is a `flash.geom.Point` instance. The x and y properties of each point are normalized to fall between `0` and `1`, where `0` is the value of the animation property at the beginning of the tween, and `1` is the value at the end of the tween. The first and last points of the curve are not included in the array because the first point is locked to the starting value defined by the current keyframe, and the last point is locked to the ending value defined by the next keyframe. On the custom easing curve, these points correspond to values of (0, 0) and (1, 1), respectively.

Related API Elements

flash.geom.Point

### target

property

`target:String`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The name of the animation property to target.

The default value is `"".`

Implementation
`public function get target():String`
`public function set target(value:String):void`

Related API Elements

fl.motion.ITween.target
Constructor Detail

### CustomEase

()
Constructor

`public function CustomEase(xml:XML = null)`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Constructor for CustomEase instances.

Parameters

| `xml:XML` (default = `null`)`` — Optional E4X XML object defining a CustomEase in Motion XML format.

Method Detail

### getValue

()
method

`public function getValue(time:Number, begin:Number, change:Number, duration:Number):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Calculates an interpolated value for a numerical property of animation, using a custom easing curve. The percent value is read from the CustomEase instance's `points` property, rather than being passed into the method. Using the property value allows the function signature to match the ITween interface.

Parameters

| `time:Number` — The time value, which must lie between `0` and `duration`, inclusive. You can choose any unit (for example. frames, seconds, milliseconds), but your choice must match the `duration` unit.
| `begin:Number` — The value of the animation property at the start of the tween, when time is 0.
| `change:Number` — The change in the value of the animation property over the course of the tween. The value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the `change` is `-30`.
| `duration:Number` — The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the `time` unit.

Returns

| `Number` — The interpolated value at the specified time.

Related API Elements

points

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