Packagecom.boostworthy.animation.management
Classpublic class AnimationManager
Implementsflash.events.IEventDispatcher, IDisposable

The 'AnimationManager' class creates a quick and easy approach to simple animations. For more complex animation sequences, the 'Timeline' object is a better canidate.

See also

com.boostworthy.animation.sequence.Timeline


Protected Properties
 PropertyDefined by
  m_objFramebuffer : Framebuffer
A framebuffer instance for managing all animations to be rendered.
AnimationManager
Public Methods
 MethodDefined by
  
Constructor.
AnimationManager
  
addEventListener(strType:String, fncListener:Function, bUseCapture:Boolean = false, iPriority:int = 0, bUseWeakReference:Boolean = false):void
Adds an animation event listener to the framebuffer.
AnimationManager
  
alpha(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the 'alpha' property of a display object to the desired target value.
AnimationManager
  
blur(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nQuality:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the 'blurX' and 'blurX' filter properties of a display object to the desired target values.
AnimationManager
  
brightness(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the brightness of a 'colorable' object to the desired target color value.
AnimationManager
  
color(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the color of a display object to the desired target color value.
AnimationManager
  
contrast(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the contrast of a 'colorable' object to the desired target color value.
AnimationManager
  
dispatchEvent(objEvent:Event):Boolean
Dispatches the specified event.
AnimationManager
  
dispose():void
Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.
AnimationManager
  
filter(objTarget:DisplayObject, objFilter:Class, strProperty:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the property of any object's filter to a specified target value.
AnimationManager
  
functions(objTarget:Object, strGetFunction:String, strSetFunction:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates any value that is accessed through get and set functions instead of getter/setters.
AnimationManager
  
hasEventListener(strType:String):Boolean
Check to see if the event dispatcher has any listeners registered for the specified event type.
AnimationManager
  
hue(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the hue of a 'colorable' object to the desired target color value.
AnimationManager
  
initColor(objTarget:DisplayObject, nColorValue:Number):void
Initializes the color of a display object so that it's color can be animated.
AnimationManager
  
move(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the 'x' and 'y' properties of a display object to the desired target values.
AnimationManager
  
property(objTarget:Object, strProperty:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates any object's property to the desired target value.
AnimationManager
  
pulse(objTarget:Object, strProperty:String, nMin:Number, nMax:Number, nDuration:Number, uRenderMethod:uint):void
Animates any object's property back and forth between a minimum and maximum value using a sine wave.
AnimationManager
  
remove(objTarget:Object):void
Removes all instances of the specified object from the framebuffer.
AnimationManager
  
removeAll():void
Removes all animations currently in the framebuffer.
AnimationManager
  
removeEventListener(strType:String, fncListener:Function, bUseCapture:Boolean = false):void
Removes an animation event listener from the framebuffer.
AnimationManager
  
rotation(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, uNumRepeats:uint = 1, strTransition:String, uRenderMethod:uint):void
Animates the 'rotation' property of a display object to the desired target value.
AnimationManager
  
saturation(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the saturation of a 'colorable' object to the desired target color value.
AnimationManager
  
scale(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the 'scaleX' and 'scaleY' properties of a display object to the desired target values.
AnimationManager
  
size(objTarget:DisplayObject, nTargetValueW:Number, nTargetValueH:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void
Animates the 'width' and 'height' properties of a display object to the desired target values.
AnimationManager
  
willTrigger(strType:String):Boolean
Check to see if the event dispatcher or any of it's ancestors have any listeners registered for the specified event type.
AnimationManager
Protected Methods
 MethodDefined by
  
init():void
Initializes this object.
AnimationManager
  
setStageReference(objTarget:DisplayObject):void
Sets a global reference to the 'Stage' if one doesn't already exist.
AnimationManager
Events
 EventSummaryDefined by
   Dispatched when an animation changes.AnimationManager
   Dispatched when an animation is finished.AnimationManager
   Dispatched when an animation starts.AnimationManager
   Dispatched when an animation stops.AnimationManager
Protected Constants
 ConstantDefined by
  DEFAULT_REFRESH_RATE : Number = 10
Configures the default refresh rate to be used.
AnimationManager
  DEFAULT_RENDER_METHOD : uint = 2
Configures the default render method for rendering animations.
AnimationManager
  DEFAULT_TRANSITION : String = "linear"
Configures the default animation transition.
AnimationManager
Property detail
m_objFramebufferproperty
protected var m_objFramebuffer:Framebuffer

A framebuffer instance for managing all animations to be rendered.

See also

Constructor detail
AnimationManager()constructor
public function AnimationManager()

Constructor.

Method detail
addEventListener()method
public function addEventListener(strType:String, fncListener:Function, bUseCapture:Boolean = false, iPriority:int = 0, bUseWeakReference:Boolean = false):void

Adds an animation event listener to the framebuffer.

Parameters

strType:String — The event type being listened for.
 
fncListener:Function — A reference to the event handler to be called upon the event being dispatched.
 
bUseCapture:Boolean (default = false)
 
iPriority:int (default = 0)
 
bUseWeakReference:Boolean (default = false)

See also

alpha()method 
public function alpha(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the 'alpha' property of a display object to the desired target value.

The advantage to using this method over the method 'Property' is that a.) it is slightly faster since the property is hard-coded into the animation instead of dynamically accessed each update and more importantly b.) it checks the alpha property at the end of the animation and if the value is '0', it sets the target object's visibility to 'false'. If you need the visibility to remain untouched, use the 'Property' method instead.

Parameters

objTarget:DisplayObject — A reference to the object whose property is being animated.
 
nTargetValue:Number — The target value for the 'alpha' property of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

blur()method 
public function blur(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nQuality:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the 'blurX' and 'blurX' filter properties of a display object to the desired target values.

Parameters

objTarget:DisplayObject — A reference to the object whose blur filter propertes are being animated.
 
nTargetValueX:Number — The target value for the 'blurX' property of the target object's blur filter. A value that is a power of two is recommended for maximum performance.
 
nTargetValueY:Number — The target value for the 'blurY' property of the target object's blur filter. A value that is a power of two is recommended for maximum performance.
 
nQuality:Number — The quality of the blur being applied.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

brightness()method 
public function brightness(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the brightness of a 'colorable' object to the desired target color value.

Parameters

objTarget:IColorable — A reference to the object whose brightness value is being animated.
 
nTargetValue:Number — The target brightness value of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

color()method 
public function color(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the color of a display object to the desired target color value.

NOTE: If a display object doesn't already have a color transformation object applied to it, use the 'InitColor' method to initialize it's starting color.

Parameters

objTarget:DisplayObject — A reference to the object whose color value is being animated.
 
nTargetValue:Number — The target color value of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

contrast()method 
public function contrast(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the contrast of a 'colorable' object to the desired target color value.

Parameters

objTarget:IColorable — A reference to the object whose contrast value is being animated.
 
nTargetValue:Number — The target contrast value of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

dispatchEvent()method 
public function dispatchEvent(objEvent:Event):Boolean

Dispatches the specified event.

Parameters
objEvent:Event — The event to dispatch.

Returns
Boolean — A value of 'true' unless 'preventDefault()' is called on the event, in which case it returns 'false'.
dispose()method 
public function dispose():void

Performs any appropriate clean-up tasks for garbage collection such as removing event listeners, setting object references to 'null', etc.

filter()method 
public function filter(objTarget:DisplayObject, objFilter:Class, strProperty:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the property of any object's filter to a specified target value. The filter must already be applied to the display object; one will not be added for you if it is not present.

Parameters

objTarget:DisplayObject — A reference to the object whose filter is being animated.
 
objFilter:Class — The filter class whose property is being animated. The filter must already be applied to the display object prior to being animated.
 
strProperty:String — The property of the target object's filter that is being animated.
 
nTargetValue:Number — The value the property is being animated to.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

functions()method 
public function functions(objTarget:Object, strGetFunction:String, strSetFunction:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates any value that is accessed through get and set functions instead of getter/setters.

Parameters

objTarget:Object — A reference to the object whose functions are being used to animate a value.
 
strGetFunction:String — The get function of the target object that is being animated.
 
strSetFunction:String — The set function of the target object that is being animated.
 
nTargetValue:Number — The target value the object's value is getting animated to.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

hasEventListener()method 
public function hasEventListener(strType:String):Boolean

Check to see if the event dispatcher has any listeners registered for the specified event type.

Parameters
strType:String — The type of event.

Returns
Boolean — A value of 'true' if a listener of the specified type is registered; 'false' otherwise.
hue()method 
public function hue(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the hue of a 'colorable' object to the desired target color value.

Parameters

objTarget:IColorable — A reference to the object whose hue value is being animated.
 
nTargetValue:Number — The target hue value of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

init()method 
protected function init():void

Initializes this object.

initColor()method 
public function initColor(objTarget:DisplayObject, nColorValue:Number):void

Initializes the color of a display object so that it's color can be animated. Use this method to set the starting color of a display object before calling the 'Color' method.

Parameters

objTarget:DisplayObject — The display object to initialize color for.
 
nColorValue:Number — The color value to apply to the target display object.

See also

move()method 
public function move(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the 'x' and 'y' properties of a display object to the desired target values.

Parameters

objTarget:DisplayObject — A reference to the object whose properties are being animated.
 
nTargetValueX:Number — The target value for the 'x' property of the target object.
 
nTargetValueY:Number — The target value for the 'y' property of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

property()method 
public function property(objTarget:Object, strProperty:String, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates any object's property to the desired target value.

Parameters

objTarget:Object — A reference to the object whose property is being animated.
 
strProperty:String — The name of the property being animated.
 
nTargetValue:Number — The value the property is getting animated to.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

pulse()method 
public function pulse(objTarget:Object, strProperty:String, nMin:Number, nMax:Number, nDuration:Number, uRenderMethod:uint):void

Animates any object's property back and forth between a minimum and maximum value using a sine wave. In this case, the duration is how long a single wave cycle takes to occur, thus impacting the speed of the pulse. A pulse animation will coninue to occur until it is removed from the framebuffer using the 'Remove' or 'RemoveAll' methods of this manager.

Parameters

objTarget:Object — A reference to the object whose property is being animated.
 
strProperty:String — The name of the property being animated.
 
nMin:Number — The minimum value output by the pulse.
 
nMax:Number — The maximum value output by the pulse.
 
nDuration:Number — The amount of time it takes for one wave cycle (Min -> Max -> Min).
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

remove()method 
public function remove(objTarget:Object):void

Removes all instances of the specified object from the framebuffer.

Parameters
objTarget:Object — The object to remove from the framebuffer.
removeAll()method 
public function removeAll():void

Removes all animations currently in the framebuffer.

removeEventListener()method 
public function removeEventListener(strType:String, fncListener:Function, bUseCapture:Boolean = false):void

Removes an animation event listener from the framebuffer.

Parameters
strType:String — The event type being listened for.
 
fncListener:Function — A reference to the event handler to be called upon the event being dispatched.
 
bUseCapture:Boolean (default = false)

See also

rotation()method 
public function rotation(objTarget:DisplayObject, nTargetValue:Number, nDuration:Number, uNumRepeats:uint = 1, strTransition:String, uRenderMethod:uint):void

Animates the 'rotation' property of a display object to the desired target value.

The advantage of using this method over the generic 'Property' method is that you can specify the amount of times the animation occurs using the 'number of repeats' parameter. If the number of repeats is set to '1', the animation will occur one time and animate the rotation property to the specified target value. If a value other than '1' is used, the animation will occur the set number of times, but instead of animating the rotation property to the target value, the target value will be added to the current rotation value each time the animation occurs. A value of '0' for the number of repeats will cause the animation to continue until it is manually removed.

Parameters

objTarget:DisplayObject — A reference to the object whose property is being animated.
 
nTargetValue:Number — The target value for the 'rotation' property of the target object. If a repeat count other than '1' is used, this will be used as the amount to change the value instead of being a target value.
 
nDuration:Number — The duration of the animation in milliseconds.
 
uNumRepeats:uint (default = 1) — The number of times to repeat the animation. A value of '0' will cause the animation to continue until manually removed.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

saturation()method 
public function saturation(objTarget:IColorable, nTargetValue:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the saturation of a 'colorable' object to the desired target color value.

Parameters

objTarget:IColorable — A reference to the object whose saturation value is being animated.
 
nTargetValue:Number — The target saturation value of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

scale()method 
public function scale(objTarget:DisplayObject, nTargetValueX:Number, nTargetValueY:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the 'scaleX' and 'scaleY' properties of a display object to the desired target values.

Parameters

objTarget:DisplayObject — A reference to the object whose properties are being animated.
 
nTargetValueX:Number — The target value for the 'scaleX' property of the target object.
 
nTargetValueY:Number — The target value for the 'scaleY' property of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

setStageReference()method 
protected function setStageReference(objTarget:DisplayObject):void

Sets a global reference to the 'Stage' if one doesn't already exist.

Parameters
objTarget:DisplayObject — A display object to grab a reference to the stage from.

See also

size()method 
public function size(objTarget:DisplayObject, nTargetValueW:Number, nTargetValueH:Number, nDuration:Number, strTransition:String, uRenderMethod:uint):void

Animates the 'width' and 'height' properties of a display object to the desired target values.

Parameters

objTarget:DisplayObject — A reference to the object whose properties are being animated.
 
nTargetValueW:Number — The target value for the 'width' property of the target object.
 
nTargetValueH:Number — The target value for the 'height' property of the target object.
 
nDuration:Number — The duration of the animation in milliseconds.
 
strTransition:String — The transition to be used for the animation. If one is not specified, the 'DEFAULT_TRANSITION' is used.
 
uRenderMethod:uint — The render method to use for rendering this object. If one is not specified, the 'DEFAULT_RENDER_METHOD' is used.

See also

willTrigger()method 
public function willTrigger(strType:String):Boolean

Check to see if the event dispatcher or any of it's ancestors have any listeners registered for the specified event type.

Parameters
strType:String — The type of event.

Returns
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
Event detail
animationChangeevent 
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation changes.

animationFinishevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation is finished.

animationStartevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation starts.

animationStopevent  
Event object type: com.boostworthy.events.AnimationEvent

Dispatched when an animation stops.

Constant detail
DEFAULT_REFRESH_RATEconstant
protected const DEFAULT_REFRESH_RATE:Number = 10

Configures the default refresh rate to be used. This value is the interval in which animations being rendered using the 'RenderMethod.TIMER' method will be refreshed. The value is in milliseconds.

See also

DEFAULT_RENDER_METHODconstant 
protected const DEFAULT_RENDER_METHOD:uint = 2

Configures the default render method for rendering animations.

See also

DEFAULT_TRANSITIONconstant 
protected const DEFAULT_TRANSITION:String = "linear"

Configures the default animation transition.

See also