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

Keyframe  - AS3 Flash

Packagefl.motion
Classpublic class Keyframe
InheritanceKeyframe Inheritance KeyframeBase Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

The Keyframe class defines the visual state at a specific time in a motion tween. The primary animation properties are position, scale, rotation, skew, and color. A keyframe can, optionally, define one or more of these properties. For instance, one keyframe may affect only position, while another keyframe at a different point in time may affect only scale. Yet another keyframe may affect all properties at the same time. Within a motion tween, each time index can have only one keyframe. A keyframe also has other properties like blend mode, filters, and cacheAsBitmap, which are always available. For example, a keyframe always has a blend mode.

Note: In Flash CS3, many of the properties and methods supported by this class were members of this class, exclusively. Flash CS4 introduced a base class, KeyframeBase, for those properties and methods of this class, and they are now shared by other classes through the inheritance chain. If you have been working in Flash CS3, notice that these properties and methods are still supported by the Keyframe class, but are members of the KeyframeBase class in releases of Flash Professional after Flash CS3. As with any other class in this reference, select Show Inherited Public Properties and Show Inherited Public Methods to see all of the properties and methods supported by this class.

Related API Elements



Public Properties
 PropertyDefined By
 InheritedadjustColorObjects : Dictionary = null
Stores AdjustColor instances mapped to their corresponding index in the filters Array for this keyframe.
KeyframeBase
 Inheritedblank : Boolean = false
Indicates that the target object should not be displayed on this keyframe.
KeyframeBase
 InheritedblendMode : String = "normal"
A value from the BlendMode class that specifies how Flash Player mixes the display object's colors with graphics underneath it.
KeyframeBase
 InheritedcacheAsBitmap : Boolean = false
If set to true, Flash Player caches an internal bitmap representation of the display object.
KeyframeBase
 Inheritedcolor : Color
A color object that adjusts the color transform in the target object.
KeyframeBase
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedfilters : Array
An array that contains each filter object to be applied to the target object at a particular keyframe.
KeyframeBase
 InheritedfirstFrame : String
Stores the name of the first frame for motion tweens, which affects graphic symbols only.
KeyframeBase
 Inheritedindex : int
The keyframe's unique time value in the motion tween.
KeyframeBase
 Inheritedlabel : String
A string used to describe the keyframe.
KeyframeBase
 Inheritedloop : String
Stores the value of the Loop checkbox for motion tweens, which affects graphic symbols only.
KeyframeBase
 Inheritedmatrix : Matrix = null
Stores matrix property if one exists for this keyframe.
KeyframeBase
 Inheritedmatrix3D : Object = null
Stores matrix3d property if one exists for this keyframe.
KeyframeBase
 InheritedopaqueBackground : Object = null
Controls whether target object has an opaque background.
KeyframeBase
 InheritedorientToPath : Boolean = false
If set to true, this property causes the target object to rotate automatically to follow the angle of its path.
KeyframeBase
 InheritedrotateDirection : String = "auto"
Controls how the target object rotates during a motion tween, with a value from the RotateDirection class.
KeyframeBase
 InheritedrotateTimes : uint = 0
Adds rotation to the target object during a motion tween, in addition to any existing rotation.
KeyframeBase
 Inheritedrotation : Number
Indicates the rotation of the target object in degrees from its original orientation as applied from the transformation point.
KeyframeBase
 InheritedrotationConcat : Number = NaN
The rotation (z-axis) values of the target object in the motion relative to previous orientation as applied from the transformation point, as opposed to absolute rotation values, and separate from skewY values.
KeyframeBase
 InheritedrotationX : Number = NaN
Stores rotationX property for this keyframe.
KeyframeBase
 InheritedrotationY : Number = NaN
Stores rotationY property for this keyframe.
KeyframeBase
 InheritedscaleX : Number = NaN
Indicates the horizontal scale as a percentage of the object as applied from the transformation point.
KeyframeBase
 InheritedscaleY : Number = NaN
Indicates the vertical scale as a percentage of the object as applied from the transformation point.
KeyframeBase
 InheritedskewX : Number = NaN
Indicates the horizontal skew angle of the target object in degrees as applied from the transformation point.
KeyframeBase
 InheritedskewY : Number = NaN
Indicates the vertical skew angle of the target object in degrees as applied from the transformation point.
KeyframeBase
  tweens : Array
An array that contains each tween object to be applied to the target object at a particular keyframe.
Keyframe
  tweenScale : Boolean = true
A flag that controls whether scale will be interpolated during a tween.
Keyframe
  tweensLength : int
[override] [read-only] The number of frames for the tween.
Keyframe
  tweenSnap : Boolean = false
Stores the value of the Snap checkbox for motion tweens, which snaps the object to a motion guide.
Keyframe
  tweenSync : Boolean = false
Stores the value of the Sync checkbox for motion tweens, which affects graphic symbols only.
Keyframe
 InheriteduseRotationConcat : Boolean = false
If set to true, this property causes the target object to rotate when data for motion is supplied by addpropertyarray.
KeyframeBase
 Inheritedvisible : Boolean = true
Controls whether target object is visible.
KeyframeBase
 Inheritedx : Number = NaN
The horizontal position of the target object's transformation point in its parent's coordinate space.
KeyframeBase
 Inheritedy : Number = NaN
The vertical position of the target object's transformation point in its parent's coordinate space.
KeyframeBase
 Inheritedz : Number = NaN
The depth (z-axis) position of the target object's transformation point in its parent's coordinate space.
KeyframeBase
Public Methods
 MethodDefined By
  
Keyframe(xml:XML = null)
Constructor for keyframe instances.
Keyframe
 Inherited
affectsTweenable(tweenableName:String = ""):Boolean
Indicates whether the keyframe has an influence on a specific animation property.
KeyframeBase
  
Retrieves an ITween object for a specific animation property.
Keyframe
 Inherited
getValue(tweenableName:String):Number
Retrieves the value of a specific tweenable property on the keyframe.
KeyframeBase
 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
setAdjustColorProperty(filterIndex:int, propertyName:String, value:*):void
Sets one of the four AdjustColor properties to the AdjustColor object for the given filter index.
KeyframeBase
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
setValue(tweenableName:String, newValue:Number):void
Changes the value of a specific tweenable property on the keyframe.
KeyframeBase
 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

tweens

property
public var tweens:Array

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

An array that contains each tween object to be applied to the target object at a particular keyframe. One tween can target all animation properties (as with standard tweens on the Flash authoring tool's timeline), or multiple tweens can target individual properties (as with separate custom easing curves).

tweenScale

property 
public var tweenScale:Boolean = true

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

A flag that controls whether scale will be interpolated during a tween. If false, the display object will stay the same size during the tween, until the next keyframe.

tweensLength

property 
tweensLength:int  [read-only] [override]

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

The number of frames for the tween.



Implementation
    override public function get tweensLength():int

tweenSnap

property 
public var tweenSnap:Boolean = false

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

Stores the value of the Snap checkbox for motion tweens, which snaps the object to a motion guide. This property is used in the Copy and Paste Motion feature in Flash CS4 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler.

tweenSync

property 
public var tweenSync:Boolean = false

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

Stores the value of the Sync checkbox for motion tweens, which affects graphic symbols only. This property is used in the Copy and Paste Motion feature in Flash CS4 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler.

Constructor Detail

Keyframe

()Constructor
public function Keyframe(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 keyframe instances.

Parameters
xml:XML (default = null) — Optional E4X XML object defining a keyframe in Motion XML format.
Method Detail

getTween

()method
public function getTween(target:String = ""):fl.motion:ITween

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9.0.28.0, AIR 1.0

Retrieves an ITween object for a specific animation property.

Parameters

target:String (default = "") — The name of the property being tweened.

Returns
fl.motion:ITween — An object that implements the ITween interface.

Related API Elements