ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
fl.motion 

CustomEase  - AS3 Flash

Packagefl.motion
Classpublic class CustomEase
InheritanceCustomEase Inheritance 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 Propertypoints

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : 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
 MethodDefined 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
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
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

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

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