Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
The Motion class stores a keyframe animation sequence that can be applied to a visual object.
The animation data includes position, scale, rotation, skew, color, filters, and easing.
The Motion class has methods for retrieving data at specific points in time, and
interpolating values between keyframes automatically.
keyframesCompact
duration:int
[read-write]
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Controls the Motion instance's length of time, measured in frames.
The duration cannot be less than the time occupied by the Motion instance's keyframes.
The default value is 0
.
Implementation
public function get duration():int
public function set duration(value:int):void
public var keyframes:Array
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
An array of keyframes that define the motion's behavior over time.
This property is a sparse array, where a keyframe is placed at an index in the array
that matches its own index. A motion object with keyframes at 0 and 5 has
a keyframes array with a length of 6.
Indices 0 and 5 in the array each contain a keyframe,
and indices 1 through 4 have null values.
public var keyframes:Array
public var keyframesCompact:Array
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
A compact array of keyframes, where each index is occupied by a keyframe.
By contrast, a sparse array has empty indices (as in the keyframes
property).
In the compact array, no null
values are used to fill indices between keyframes.
However, the index of a keyframe in keyframesCompact
likely does not match its index in the keyframes
array.
This property is primarily used for compatibility with the Flex MXML compiler,
which generates a compact array from the motion XML.
See also
public var source:Source
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
An object that stores information about the context in which the motion was created,
such as framerate, dimensions, transformation point, and initial position, scale, rotation and skew.
public function Motion(xml:XML = null)
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Constructor for Motion instances.
By default, one initial keyframe is created automatically, with default transform properties.
Parameters
| xml:XML (default = null ) — Optional E4X XML object defining a Motion instance.
|
public function addKeyframe(newKeyframe:Keyframe):void
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Adds a keyframe object to the Motion instance.
Parameters
| newKeyframe:Keyframe — A keyframe object with an index property already set.
|
See also
public static function fromXMLString(xmlString:String):Motion
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
A method needed to create a Motion instance from a string of XML.
Parameters
| xmlString:String — A string of motion XML.
|
Returns
| Motion — A new Motion instance.
|
public function getColorTransform(index:int):ColorTransform
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Retrieves an interpolated ColorTransform object at a specific time index in the Motion instance.
Parameters
| index:int — The time index of a frame in the Motion instance, as an integer greater than or equal to zero.
|
Returns
See also
public function getCurrentKeyframe(index:int, tweenableName:String = ""):Keyframe
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Retrieves the keyframe that is currently active at a specific frame in the Motion instance.
A frame that is not a keyframe derives its values from the keyframe that preceded it.
This method can also filter values by the name of a specific tweenables property.
You can find the currently active keyframe for x
, which may not be
the same as the currently active keyframe in general.
Parameters
| index:int — The index of a frame in the Motion instance, as an integer greater than or equal to zero.
|
|
| tweenableName:String (default = " ") — Optional name of a tweenable's property (like "x" or "rotation" ).
|
Returns
| Keyframe — The closest matching keyframe at or before the supplied frame index.
|
See also
public function getFilters(index:Number):Array
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Retrieves an interpolated array of filters at a specific time index in the Motion instance.
Parameters
| index:Number — The time index of a frame in the Motion, as an integer greater than or equal to zero.
|
Returns
| Array — The interpolated array of filters.
If there are no applicable filters, returns an empty array.
|
See also
public function getNextKeyframe(index:int, tweenableName:String = ""):Keyframe
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Retrieves the next keyframe after a specific frame in the Motion instance.
If a frame is not a keyframe, and is in the middle of a tween,
this method derives its values from both the preceding keyframe and the following keyframe.
This method can also filter by the name of a specific tweenables property.
This allows you to find the next keyframe for x
, which may not be
the same as the next keyframe in general.
Parameters
| index:int — The index of a frame in the Motion instance, as an integer greater than or equal to zero.
|
|
| tweenableName:String (default = " ") — Optional name of a tweenable's property (like "x" or "rotation" ).
|
Returns
| Keyframe — The closest matching keyframe after the supplied frame index.
|
See also
public function getValue(index:Number, tweenableName:String):Number
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Retrieves the value for an animation property at a point in time.
Parameters
| index:Number — The time index of a frame in the Motion instance, as an integer greater than or equal to zero.
|
|
| tweenableName:String — The name of a tweenable's property (like "x" or "rotation" ).
|
Returns
See also
public static function interpolateFilter(fromFilter:BitmapFilter, toFilter:BitmapFilter, progress:Number):BitmapFilter
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Blends filters smoothly from one filter object to another.
Parameters
| fromFilter:BitmapFilter — The starting filter object.
|
|
| toFilter:BitmapFilter — The ending filter object.
|
|
| progress:Number — The percent of the transition as a decimal, where 0 is the start and 1 is the end.
|
Returns
See also
public static function interpolateFilters(fromFilters:Array, toFilters:Array, progress:Number):Array
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Blends filters smoothly from one array of filter objects to another.
Parameters
| fromFilters:Array — The starting array of filter objects.
|
|
| toFilters:Array — The ending array of filter objects.
|
|
| progress:Number — The percent of the transition as a decimal, where 0 is the start and 1 is the end.
|
Returns
| Array — The interpolated array of filter objects.
|
See also
public function setValue(index:int, tweenableName:String, value:Number):void
Language Version : | ActionScript 3.0 |
Player Version : | Flash Player 9.0.28.0 |
Sets the value of a specific tweenables property at a given time index in the Motion instance.
If a keyframe doesn't exist at the index, one is created automatically.
Parameters
| index:int — The time index of a frame in the Motion instance, as an integer greater than zero.
If the index is zero, no change is made.
Because the transform properties are relative to the starting transform of the target object,
the first frame's values are always default values and should not be changed.
|
|
| tweenableName:String — The name of a tweenable's property (like "x" or "rotation" ).
|
|
| value:Number — The new value of the tweenable property.
|
See also
© 2004-2007 Adobe Systems Incorporated. All rights reserved.
Tue Mar 18 2008, 12:59 PM GMT-07:00