TweenEx |
Extends the Tween class with dispose and extended properties on objects. Such as ‘transform.matrix.tx’, ‘transform.colorTransform.redMultiplier’ and arrays such as ‘filters.DropShadowFilter.angle’ and so on. Thus properties that would otherwise require the use of the Animation classes can be tweened and therefore used via the Timeline and TimeLineEx classes. It is assumed that the tweened class has any extended property that is being tweened, otherwise it is ignored.
// Usage on a Shape or Sprite m_Box object that has a drop shadow filter: m_Box.transform.colorTransform = new ColorTransform(); m_objTimeline.AddTween(new TweenEx(m_Box, "transform.colorTransform.redMultiplier", 0.5, 1, 270, Transitions.SINE_IN_AND_OUT)); m_objTimeline.AddTween(new TweenEx(m_Box, "filters.DropShadowFilter.angle", 0.0, 1, 270, Transitions.SINE_IN_AND_OUT)); m_objTimeline.AddTween(new TweenEx(m_Box, "filters.DropShadowFilter.distance", 20.0, 1, 270, Transitions.SINE_IN_AND_OUT));
TweenEx | Extends the Tween class with dispose and extended properties on objects. |
Property type constants | |
TYPE_DISPLAY | Property that exists on directly on a display object |
TYPE_MATRIX | Property on a display object’s transform matrix |
TYPE_COLOR | Property on a display object’s color transform |
TYPE_BEVEL | Property on a display object’s bevel filter |
TYPE_BLUR | Property on a display object’s blur filter |
TYPE_SHADOW | Property on a display object’s drop shadow filter |
Internal Members | |
qualifiedPropertyName | The fully dot qualified property name or null if it is not an extended property |
extendedPropertyName | The base property name for example ‘transform’ or ‘filters’ |
extendedPropertyObjectName | The object or class property name for example ‘matrix’, ‘colorTransform’, ‘DropShadowFilter’, ... |
Object Manipulation | |
TweenEx | Initializes an extended tween object. |
clone | Makes a copy of the object. |
dispose | Cleans up resources used by this object. |
Extended properties | |
renderFrame | Renders the specified frame of this tween. |
findFilterIndex | Find the first filter on the displayObject which class matches the filterClassName |
Tween Data Access | |
property | Read-only string of the tweened property. |
targetValue | Read-only number of the target value for the tween. |
transition | Read-only string indicating the transition type. |
refresh | Refresh the tween from referenced data. |
Property classification | |
getPropertyType | Classifies the property into a property type group. |
public function TweenEx( objToTween: Object, strProperty: String, nTargetValue: Number, uFirstFrame: uint, uLastFrame: uint, strTransition: String )
Initializes an extended tween object. Differs from Tween in that strProperty can be either a simple property or a dot qualified property such as ‘transform.matrix.tx’, ‘transform.colorTransform.redMultiplier’ or ‘filters.DropShadowFilter.angle’.
public override function renderFrame( uFrame: uint ):void
Renders the specified frame of this tween. Uses the base class to do the actual rendering, but prepares extended properties in such a way that they can be rendered by the base class as if they where plain properties.
uFrame | the frame number to render |
private function findFilterIndex( displayObject: DisplayObject, filterClassName: String ):int
Find the first filter on the displayObject which class matches the filterClassName
displayObject | The display object on which to find the filter |
filterClassName | The flash filters class name as a string |
The index of the first filter with the class or -1 if no such filter was found
public static function getPropertyType( property: String ):String
Classifies the property into a property type group.
property | The property to classify as a string |
A property type constant as a string
See also: TYPE_DISPLAY, TYPE_MATRIX, TYPE_COLOR, TYPE_BEVEL, TYPE_BLUR, TYPE_SHADOW
Property that exists on directly on a display object
public static const TYPE_DISPLAY: String
Property on a display object’s transform matrix
public static const TYPE_MATRIX: String
Property on a display object’s color transform
public static const TYPE_COLOR: String
Property on a display object’s bevel filter
public static const TYPE_BEVEL: String
Property on a display object’s blur filter
public static const TYPE_BLUR: String
Property on a display object’s drop shadow filter
public static const TYPE_SHADOW: String
The fully dot qualified property name or null if it is not an extended property
protected var qualifiedPropertyName: String
The base property name for example ‘transform’ or ‘filters’
protected var extendedPropertyName: String
The object or class property name for example ‘matrix’, ‘colorTransform’, ‘DropShadowFilter’, ...
protected var extendedPropertyObjectName: String
Initializes an extended tween object.
public function TweenEx( objToTween: Object, strProperty: String, nTargetValue: Number, uFirstFrame: uint, uLastFrame: uint, strTransition: String )
Makes a copy of the object.
public override function clone():ITween
Cleans up resources used by this object.
public function dispose():void
Renders the specified frame of this tween.
public override function renderFrame( uFrame: uint ):void
Find the first filter on the displayObject which class matches the filterClassName
private function findFilterIndex( displayObject: DisplayObject, filterClassName: String ):int
Read-only string of the tweened property.
public override function get property():String
Read-only number of the target value for the tween.
public function get targetValue():Number
Read-only string indicating the transition type.
public function get transition():String
Refresh the tween from referenced data.
public function refresh():void
Classifies the property into a property type group.
public static function getPropertyType( property: String ):String