Packagefl.motion
Classpublic class Keyframe
InheritanceKeyframe Inheritance Object

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.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.

See also

Motion XML Elements


Public Properties
 PropertyDefined By
  blank : Boolean = false
Indicates that the target object should not be displayed on this keyframe.
Keyframe
  blendMode : String = "normal"
A value from the BlendMode class that specifies how Flash Player mixes the display object's colors with graphics underneath it.
Keyframe
  cacheAsBitmap : Boolean = false
If set to true, Flash Player caches an internal bitmap representation of the display object.
Keyframe
  color : Color
A color object that adjusts the color transform in the target object.
Keyframe
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  filters : Array
An array that contains each filter object to be applied to the target object at a particular keyframe.
Keyframe
  filters : Array
Keyframe
  firstFrame : String
Stores the name of the first frame for motion tweens, which affects graphic symbols only.
Keyframe
  index : int
The keyframe's unique time value in the motion tween.
Keyframe
  label : String = ""
A string used to describe the keyframe.
Keyframe
  loop : String
Stores the value of the Loop checkbox for motion tweens, which affects graphic symbols only.
Keyframe
  orientToPath : Boolean = false
If set to true, this property causes the target object to rotate automatically to follow the angle of its path.
Keyframe
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  rotateDirection : String = "auto"
Controls how the target object rotates during a motion tween, with a value from the RotateDirection class.
Keyframe
  rotateTimes : uint = 0
Adds rotation to the target object during a motion tween, in addition to any existing rotation.
Keyframe
  rotation : Number
Indicates the rotation of the target object in degrees from its original orientation as applied from the transformation point.
Keyframe
  scaleX : Number = NaN
Indicates the horizontal scale as a percentage of the object as applied from the transformation point.
Keyframe
  scaleY : Number = NaN
Indicates the vertical scale as a percentage of the object as applied from the transformation point.
Keyframe
  skewX : Number = NaN
Indicates the horizontal skew angle of the target object in degrees as applied from the transformation point.
Keyframe
  skewY : Number = NaN
Indicates the vertical skew angle of the target object in degrees as applied from the transformation point.
Keyframe
  tweens : Array
An array that contains each tween object to be applied to the target object at a particular keyframe.
Keyframe
  tweens : Array
Keyframe
  tweenScale : Boolean = true
A flag that controls whether scale will be interpolated during a 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
  x : Number = NaN
The horizontal position of the target object's transformation point in its parent's coordinate space.
Keyframe
  y : Number = NaN
The vertical position of the target object's transformation point in its parent's coordinate space.
Keyframe
Public Methods
 MethodDefined By
  
Keyframe(xml:XML = null)
Constructor for keyframe instances.
Keyframe
  
affectsTweenable(tweenableName:String = ""):Boolean
Indicates whether the keyframe has an influence on a specific animation property.
Keyframe
  
getTween(target:String = ""):ITween
Retrieves an ITween object for a specific animation property.
Keyframe
  
getValue(tweenableName:String):Number
Retrieves the value of a specific tweenable property on the keyframe.
Keyframe
 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
  
setValue(tweenableName:String, newValue:Number):void
Changes the value of a specific tweenable property on the keyframe.
Keyframe
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail
blankproperty
public var blank:Boolean = false

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates that the target object should not be displayed on this keyframe.

blendModeproperty 
public var blendMode:String = "normal"

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

A value from the BlendMode class that specifies how Flash Player mixes the display object's colors with graphics underneath it.

See also

cacheAsBitmapproperty 
public var cacheAsBitmap:Boolean = false

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

If set to true, Flash Player caches an internal bitmap representation of the display object. Using this property often allows faster rendering than the default use of vectors.

colorproperty 
public var color:Color

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

A color object that adjusts the color transform in the target object.

filtersproperty 
public var filters:Array

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

An array that contains each filter object to be applied to the target object at a particular keyframe.

filtersproperty 
public var filters:Array
firstFrameproperty 
public var firstFrame:String

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

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

indexproperty 
index:int  [read-write]

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The keyframe's unique time value in the motion tween. The first frame in a motion tween has an index of 0.


Implementation
    public function get index():int
    public function set index(value:int):void
labelproperty 
public var label:String = ""

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

A string used to describe the keyframe.

loopproperty 
public var loop:String

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

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

orientToPathproperty 
public var orientToPath:Boolean = false

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

If set to true, this property causes the target object to rotate automatically to follow the angle of its path.

rotateDirectionproperty 
public var rotateDirection:String = "auto"

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Controls how the target object rotates during a motion tween, with a value from the RotateDirection class.

See also

rotateTimesproperty 
public var rotateTimes:uint = 0

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Adds rotation to the target object during a motion tween, in addition to any existing rotation. This rotation is dependent on the value of the rotateDirection property, which must be set to RotateDirection.CW or RotateDirection.CCW. The rotateTimes value must be an integer that is equal to or greater than zero.

For example, if the object would normally rotate from 0 to 40 degrees, setting rotateTimes to 1 and rotateDirection to RotateDirection.CW will add a full turn, for a total rotation of 400 degrees.

If rotateDirection is set to RotateDirection.CCW, 360 degrees will be subtracted from the normal rotation, resulting in a counterclockwise turn of 320 degrees.

See also

rotationproperty 
rotation:Number  [read-write]

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates the rotation of the target object in degrees from its original orientation as applied from the transformation point. A value of NaN means that the keyframe does not affect this property.


Implementation
    public function get rotation():Number
    public function set rotation(value:Number):void
scaleXproperty 
public var scaleX:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates the horizontal scale as a percentage of the object as applied from the transformation point. A value of 1 is 100% of normal size. A value of NaN means that the keyframe does not affect this property.

scaleYproperty 
public var scaleY:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates the vertical scale as a percentage of the object as applied from the transformation point. A value of 1 is 100% of normal size. A value of NaN means that the keyframe does not affect this property.

skewXproperty 
public var skewX:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates the horizontal skew angle of the target object in degrees as applied from the transformation point. A value of NaN means that the keyframe does not affect this property.

skewYproperty 
public var skewY:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates the vertical skew angle of the target object in degrees as applied from the transformation point. A value of NaN means that the keyframe does not affect this property.

tweensproperty 
public var tweens:Array

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.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).

tweensproperty 
public var tweens:Array
tweenScaleproperty 
public var tweenScale:Boolean = true

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.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.

tweenSnapproperty 
public var tweenSnap:Boolean = false

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.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 CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler.

tweenSyncproperty 
public var tweenSync:Boolean = false

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.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 CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler.

xproperty 
public var x:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The horizontal position of the target object's transformation point in its parent's coordinate space. A value of NaN means that the keyframe does not affect this property.

yproperty 
public var y:Number = NaN

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

The vertical position of the target object's transformation point in its parent's coordinate space. A value of NaN means that the keyframe does not affect this property.

Constructor Detail
Keyframe()Constructor
public function Keyframe(xml:XML = null)

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Constructor for keyframe instances.

Parameters
xml:XML (default = null) — Optional E4X XML object defining a keyframe in Motion XML format.
Method Detail
affectsTweenable()method
public function affectsTweenable(tweenableName:String = ""):Boolean

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Indicates whether the keyframe has an influence on a specific animation property.

Parameters

tweenableName:String (default = "") — The name of a tweenable property, such as "x" or "rotation".

Returns
Boolean
getTween()method 
public function getTween(target:String = ""):ITween

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Retrieves an ITween object for a specific animation property.

Parameters

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

Returns
ITween — An object that implements the ITween interface.

See also

getValue()method 
public function getValue(tweenableName:String):Number

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Retrieves the value of a specific tweenable property on the keyframe.

Parameters

tweenableName:String — The name of a tweenable property, such as "x" or "rotation".

Returns
Number — The numerical value of the tweenable property.
setValue()method 
public function setValue(tweenableName:String, newValue:Number):void

Language Version : ActionScript 3.0
Player Version : Flash Player 9.0.28.0

Changes the value of a specific tweenable property on the keyframe.

Parameters

tweenableName:String — The name of a tweenable property, such as "x" or "rotation".
 
newValue:Number — A numerical value to assign to the tweenable property.