fl.motion

# BezierEase - AS3 Flash

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

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The BezierEase class provides precise easing control for a motion tween between two keyframes. You can apply an instance of this class to all properties of a keyframe at once, or you can define different curves for different properties.

Both this class and the CustomEase class use one or more cubic Bezier curves to define the interpolation. However, the BezierEase class defines its coordinates slightly differently than the CustomEase class.

The BezierEase class uses literal values for the y coordinates of the curve, rather than normalized values between `0` and `1`. This allows you to create curves that cannot be created with custom easing. For example, you can create a curve where the start and end values are identical, but the curve rises and falls in between those values. Also, depending on the context, you may want to define the easing curve with literal values instead of percentages.

Default MXML Property `points`

Related API Elements

Motion XML Elements
CustomEase class

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. | BezierEase
|  | target : String The name of the animation property to target. | BezierEase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | BezierEase(xml:XML = null) Constructor for BezierEase instances. | BezierEase
|  | getValue(time:Number, begin:Number, change:Number, duration:Number):Number Calculates an interpolated value for a numerical property of animation, using a Bezier easing curve. | BezierEase
|  | 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, with `x` and `y` properties.

The x coordinate of each point represents the time coordinate of the ease, as a percentage. The x value is normalized to fall between `0` and `1`, where `0` is the beginning of the tween and `1` is the end of the tween. The y coordinate of each point contains the literal value of the animation property at that point in the ease. The y value is not normalized to fall between `0` and `1`.

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.

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

### BezierEase

()
Constructor

`public function BezierEase(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 BezierEase instances.

Parameters

| `xml:XML` (default = `null`)`` — Optional E4X XML object defining a BezierEase 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 Bezier easing curve. The percent value is read from the BezierEase instance's `points` property, rather than being passed into the method. Using the `points` property value allows the function signature to match the ITween interface.

Parameters

| `time:Number` — The time value, which must be between `0` and `duration`, inclusive. The unit can be freely chosen (for example, frames, seconds, milliseconds), but 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. This 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. The unit can be freely chosen (for example, frames, seconds, milliseconds), but 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