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.

Example

// 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));
Summary
TweenExExtends the Tween class with dispose and extended properties on objects.
Property type constants
TYPE_DISPLAYProperty that exists on directly on a display object
TYPE_MATRIXProperty on a display object’s transform matrix
TYPE_COLORProperty on a display object’s color transform
TYPE_BEVELProperty on a display object’s bevel filter
TYPE_BLURProperty on a display object’s blur filter
TYPE_SHADOWProperty on a display object’s drop shadow filter
Internal Members
qualifiedPropertyNameThe fully dot qualified property name or null if it is not an extended property
extendedPropertyNameThe base property name for example ‘transform’ or ‘filters’
extendedPropertyObjectNameThe object or class property name for example ‘matrix’, ‘colorTransform’, ‘DropShadowFilter’, ...
Object Manipulation
TweenExInitializes an extended tween object.
cloneMakes a copy of the object.
disposeCleans up resources used by this object.
Extended properties
renderFrameRenders the specified frame of this tween.
findFilterIndexFind the first filter on the displayObject which class matches the filterClassName
Tween Data Access
propertyRead-only string of the tweened property.
targetValueRead-only number of the target value for the tween.
transitionRead-only string indicating the transition type.
refreshRefresh the tween from referenced data.
Property classification
getPropertyTypeClassifies the property into a property type group.

Property type constants

TYPE_DISPLAY

public static const TYPE_DISPLAY: String

Property that exists on directly on a display object

TYPE_MATRIX

public static const TYPE_MATRIX: String

Property on a display object’s transform matrix

TYPE_COLOR

public static const TYPE_COLOR: String

Property on a display object’s color transform

TYPE_BEVEL

public static const TYPE_BEVEL: String

Property on a display object’s bevel filter

TYPE_BLUR

public static const TYPE_BLUR: String

Property on a display object’s blur filter

TYPE_SHADOW

public static const TYPE_SHADOW: String

Property on a display object’s drop shadow filter

Internal Members

qualifiedPropertyName

protected var qualifiedPropertyName: String

The fully dot qualified property name or null if it is not an extended property

extendedPropertyName

protected var extendedPropertyName: String

The base property name for example ‘transform’ or ‘filters’

extendedPropertyObjectName

protected var extendedPropertyObjectName: String

The object or class property name for example ‘matrix’, ‘colorTransform’, ‘DropShadowFilter’, ...

Object Manipulation

TweenEx

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’.

clone

public override function clone():ITween

Makes a copy of the object.

Returns

A new tween object that is a clone of this object.

dispose

public function dispose():void

Cleans up resources used by this object.

Extended properties

renderFrame

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.

Parameters

uFramethe frame number to render

findFilterIndex

private function findFilterIndex(displayObject: DisplayObject,
filterClassName: String):int

Find the first filter on the displayObject which class matches the filterClassName

Parameters

displayObjectThe display object on which to find the filter
filterClassNameThe flash filters class name as a string

Returns

The index of the first filter with the class or -1 if no such filter was found

Tween Data Access

property

public override function get property():String

Read-only string of the tweened property.

Returns

Tweened property

targetValue

public function get targetValue():Number

Read-only number of the target value for the tween.

Returns

Tween target value

transition

public function get transition():String

Read-only string indicating the transition type.

Returns

Transition type string

refresh

public function refresh():void

Refresh the tween from referenced data.

Property classification

getPropertyType

public static function getPropertyType(property: String):String

Classifies the property into a property type group.

Parameters

propertyThe property to classify as a string

Returns

A property type constant as a string

See also: TYPE_DISPLAY, TYPE_MATRIX, TYPE_COLOR, TYPE_BEVEL, TYPE_BLUR, TYPE_SHADOW

The ‘ITween’ interface defines a common interface for all tween objects.
The ‘Tween’ class tweens any property of any object.
Extended tween classes implement this interface to provide access to common properies.
public static const TYPE_DISPLAY: String
Property that exists on directly on a display object
public static const TYPE_MATRIX: String
Property on a display object’s transform matrix
public static const TYPE_COLOR: String
Property on a display object’s color transform
public static const TYPE_BEVEL: String
Property on a display object’s bevel filter
public static const TYPE_BLUR: String
Property on a display object’s blur filter
public static const TYPE_SHADOW: String
Property on a display object’s drop shadow filter
protected var qualifiedPropertyName: String
The fully dot qualified property name or null if it is not an extended property
protected var extendedPropertyName: String
The base property name for example ‘transform’ or ‘filters’
protected var extendedPropertyObjectName: String
The object or class property name for example ‘matrix’, ‘colorTransform’, ‘DropShadowFilter’, ...
public function TweenEx(objToTween: Object,
strProperty: String,
nTargetValue: Number,
uFirstFrame: uint,
uLastFrame: uint,
strTransition: String)
Initializes an extended tween object.
public override function clone():ITween
Makes a copy of the object.
public function dispose():void
Cleans up resources used by this object.
public override function renderFrame(uFrame: uint):void
Renders the specified frame of this tween.
private function findFilterIndex(displayObject: DisplayObject,
filterClassName: String):int
Find the first filter on the displayObject which class matches the filterClassName
public override function get property():String
Read-only string of the tweened property.
public function get targetValue():Number
Read-only number of the target value for the tween.
public function get transition():String
Read-only string indicating the transition type.
public function refresh():void
Refresh the tween from referenced data.
public static function getPropertyType(property: String):String
Classifies the property into a property type group.
Close