Packagecom.desuade.motion.controllers
Classpublic class Keyframe
InheritanceKeyframe Inheritance Object

Language Version : ActionScript 3
Since : 02.07.2009
Runtime Versions : AIR 1.0, Flash Player 9.0.0

Used by KeyframeContainers to set a point for a change in value during a tween.



Public Properties
 PropertyDefined By
  ease : *
The ease to use to tween to this value. Note: the ease is used for tweens that end with this value, so the ease value on the 'begin' keyframe is irrelevant.
Keyframe
  extras : Object
An object of any extra properties to be passed to the tweening engine.
Keyframe
  position : Number
A value in between 0 and 1 that specifies the relative position of the keyframe. This will effect the duration of the tween, along with the controller's 'duration' value.
Keyframe
  spread : *
The spread value for the current keyframe.
Keyframe
  value : *
The value for the given property at this keyframe. This can either be an absolute value (as a Number) or a relative value (as a String).
Keyframe
Public Methods
 MethodDefined By
  
Keyframe(position:Number, value:* = null, ease:* = null, spread:* = null, extras:Object = null)
"Keyframes" in the motion package are very similar to a keyframe on the timeline or the motion editor in Flash (and many other programs).
Keyframe
  
fromXML(xml:XML, useposition:Boolean = true):Keyframe
Configures the Keyframe from an XML object.
Keyframe
  
toXML():XML
Creates an XML object representing the Keyframe.
Keyframe
Property Detail
easeproperty
public var ease:*

The ease to use to tween to this value.

Note: the ease is used for tweens that end with this value, so the ease value on the 'begin' keyframe is irrelevant.

extrasproperty 
public var extras:Object

An object of any extra properties to be passed to the tweening engine. Such as 'bezier', 'type', 'amount', etc.

positionproperty 
public var position:Number

A value in between 0 and 1 that specifies the relative position of the keyframe.

This will effect the duration of the tween, along with the controller's 'duration' value.

spreadproperty 
public var spread:*

The spread value for the current keyframe. If this is anything besides '0', it will create a random value in between the 'value' and this spread value.

This can either be an absolute value (as a Number) or a relative value (as a String).

valueproperty 
public var value:*

The value for the given property at this keyframe.

This can either be an absolute value (as a Number) or a relative value (as a String).

Constructor Detail
Keyframe()Constructor
public function Keyframe(position:Number, value:* = null, ease:* = null, spread:* = null, extras:Object = null)

"Keyframes" in the motion package are very similar to a keyframe on the timeline or the motion editor in Flash (and many other programs). They all have a value, ease, spread, position, and an extras property.

The MotionController starts at the 'begin' keyframe, and creates a sequence of tweens connecting from keyframe-to-keyframe, all the way to the 'end' keyframe. Think in terms of a line graph, each keyframe is a 'point' on the line.

Note: the engine uses time (seconds) instead of actual frames to create motion, so these ARE NOT timeline keyframes, but rather a "virtual" specific spot during the duration of a controller where a value is changed (just like real, frame-based keyframes).

Note: if no keyframes are added, the MotionController will simply create 1 tween from 'begin' to 'end'.

Parameters
position:Number — A value between 0-1 that reprsents the position of the point, 0 being the beginning of the controller and 1 being the end point (0 and 1 are already taken by 'begin' and 'end' points)
 
value:* (default = null) — A value to tween to. The target will arive (the tween will end) at this value at the position of this point. Pass a Number for absolute, or a String for relative. null will use the target's start value.
 
ease:* (default = null) — What ease to use. Eases like 'easeOutBounce', etc. null will default to 'linear'
 
spread:* (default = null) — A value to create a random range from. If the spread doesn't equal the 'value' value or '0', a random value will be created between the 'value' and the 'spread'. Pass a Number for absolute, or a String for relative.
 
extras:Object (default = null) — An object that contains extra paramaters for the tween (depends on the tweenClass used in the KeyframeContainer)
Method Detail
fromXML()method
public function fromXML(xml:XML, useposition:Boolean = true):Keyframe

Configures the Keyframe from an XML object.

Parameters

xml:XML — The XML to use.
 
useposition:Boolean (default = true) — If true, this will use the position provided in xml. If false, it will use the Keyframe's current position value.

Returns
Keyframe — The Keyframe object (for chaining)
toXML()method 
public function toXML():XML

Creates an XML object representing the Keyframe.

Returns
XML — An XML object.