Packagecom.flashdynamix.motion
Classpublic class TweensyTimeline

TweensyTimeline groups instances of tweens which are animating for the same duration. It's important to know that these Tweens can be animating their own unique properties and from to targets TweensyTimelines are especially efficient for bulk tweening (1000+ Objects) because of their capability of grouping instances with a common timeline. The TweensyTimeline Class has events for: These events allow for predefined params to be applied when they are executed. Tweensy favours this method as it allows for predefining the event and the params it requires without all the fussiness of Event listeners.



Public Properties
 PropertyDefined by
  canRepeat : Boolean
[read-only] Defines whether the TweensyTimeline repeats.
TweensyTimeline
  defaultTween : Function
[static] The default tween which will be used when none is provided using a to, from and fromTo method.
TweensyTimeline
  delayEnd : Number = 0
Defines the delay in seconds at the end of the animation.
By default this value is 0 seconds.
TweensyTimeline
  delayStart : Number = 0
Defines the delay in seconds at the start of the animation.
By default this value is 0 seconds.
TweensyTimeline
  duration : Number
Sets and gets the current tween duration for the TweensyTimeline in seconds.
TweensyTimeline
  ease : Function
Defines the ease equation you would like to use.
TweensyTimeline
  easeParams : Array
[write-only] Sets the ease params.
TweensyTimeline
  finished : Boolean
[read-only] Determines whether or not the TweensyTimeline animation has finished.
TweensyTimeline
  hasTweens : Boolean
[read-only] Whether the TweensyTimeline has any animations.
TweensyTimeline
  onComplete : Function
Executed when the TweensyTimeline animation is complete.
TweensyTimeline
  onCompleteParams : Array
Parameters applied to the onComplete Function.
TweensyTimeline
  onRepeat : Function
Executed when the TweensyTimeline animation repeats.
TweensyTimeline
  onRepeatParams : Array
Parameters applied to the onRepeat Function.
TweensyTimeline
  onUpdate : Function
Executed on each update to the TweensyTimeline animation.
TweensyTimeline
  onUpdateParams : Array
Parameters applied to the onUpdate Function.
TweensyTimeline
  paused : Boolean
[read-only] Whether the TweensyTimeline is paused.
TweensyTimeline
  playing : Boolean
[read-only] This is when the animation is after the delay start and before its delay end.
TweensyTimeline
  position : Number
Seeks and returns the animation to a position from 0 to 1, start to end.
TweensyTimeline
  repeatCount : int = 0
The count of the number of repeats which have occured.
TweensyTimeline
  repeatEase : Array
This contains a list of ease Functions to use on each repeat for the tween animation.
i.e.
TweensyTimeline
  repeats : int = -1
The number of repeats to use.
TweensyTimeline
  repeatType : String
Defines the repeat type for the animation.
TweensyTimeline
  snapToClosest : Boolean = false
Whether the tweens contained within the TweensyTimeline class will snap tweened properties to the closest whole number.
TweensyTimeline
  time : Number
The time in seconds the TweensyTimeline has been running for
TweensyTimeline
  totalDuration : Number
[read-only] The total duration of the TweensyTimeline animation in seconds.
This is the sum of delayStart, duration and delayEnd.
TweensyTimeline
  tweens : int
[read-only] Number of tweens added to the TweensyTimeline Class.
TweensyTimeline
  useSmartRotate : Boolean = true
Whether the timelines contained within the TweensyTimeline class will use smart rotation or not.
Smart rotation will make the rotation turn in the direction which is the shortest in degrees fixing what may otherwise appear as a visual glitch even though mathimatically it is correct.
TweensyTimeline
Public Methods
 MethodDefined by
  
TweensyTimeline
  
add(instance:Object, update:Object = null):AbstractTween
TweensyTimeline
  
clear():void
Cleans the TweensyTimeline Class ready for check in to the Object Pool for reuse.
TweensyTimeline
  
dispose():void
Disposes the TweensyTimeline Class instance ready for garbage collection.
TweensyTimeline
  
from(instance:Object, from:Object, update:Object = null):void
Adds a from based tween to the properties defined in the target Object.
TweensyTimeline
  
fromTo(instance:Object, from:Object, to:Object, update:Object = null):void
Adds a from to based tween to the properties defined in the target Object.
TweensyTimeline
  
gc():void
[static] Prepares the TweensyTimeline class for garbage collection by disposing its Object Pools and making it no longer usable in the Flash application.
TweensyTimeline
  
loop():void
Forces a timeline tween to loop the animation.
A looped animation will swap the delays (delayStart & delayEnd) so that the to and from animations have the same delays.
TweensyTimeline
  
pause():void
Pauses a playing TweensyTimeline
TweensyTimeline
  
Removes tweening property tween overlaps.
TweensyTimeline
  
replay():void
Plays a timeline animation at its start position on each repeat.
TweensyTimeline
  
resume():void
Resumes a paused TweensyTimeline
TweensyTimeline
  
stop(instance:* = null, ... props):void
Allows for removing tweens via an instance or tween props by the following methods :
  • timeline.stop(instance); - stops all property tweens for this instance.
  • timeline.stop(instance, "x", "y"); - stops all x,y property tweens for this instance.
  • timeline.stop([instance1, instance2]); - stops all property tweens for these instances.
  • timeline.stop([instance1, instance2], "x", "y"); - stops all x,y property tweens for these instances.
  • timeline.stop(null, "x", "y"); - stops all x,y property tweens.
  • timeline.stop(); - stops all tweens though it is recommended to use the stopAll method as this is more efficient.
TweensyTimeline
  
stopAll():void
TweensyTimeline
  
to(instance:Object, to:Object, update:Object = null):void
Adds a to based tween to the properties defined in the target Object.
TweensyTimeline
  
toString():String
TweensyTimeline
  
update(secs:Number):Boolean
Updates the TweensyTimeline by the specified amout of time in seconds.
This function is intended for use by the Tweensy class which is controlling this timeline animation.
Though calling this function will update the timeline independtly of the mananger allowing for custom control over timelines.
TweensyTimeline
  
updateTo(instance:Object, to:Object):void
Updates a tween for the instance Object to the new target properties defined in the to Object.
TweensyTimeline
  
yoyo():void
Forces a timeline tween to do a yoyo animation.
A yoyo will use the same delayStart and delayEnd on the to and fro animation.
TweensyTimeline
Public Constants
 ConstantDefined by
  LOOP : String = "loop"
[static]
TweensyTimeline
  NONE : String = "null"
[static]
TweensyTimeline
  REPLAY : String = "replay"
[static]
TweensyTimeline
  YOYO : String = "yoyo"
[static]
TweensyTimeline
Property detail
canRepeatproperty
canRepeat:Boolean  [read-only]

Defines whether the TweensyTimeline repeats.

Implementation
    public function get canRepeat():Boolean
defaultTweenproperty 
public static var defaultTween:Function

The default tween which will be used when none is provided using a to, from and fromTo method.

See also

delayEndproperty 
public var delayEnd:Number = 0

Defines the delay in seconds at the end of the animation.
By default this value is 0 seconds.

delayStartproperty 
public var delayStart:Number = 0

Defines the delay in seconds at the start of the animation.
By default this value is 0 seconds.

durationproperty 
duration:Number  [read-write]

Sets and gets the current tween duration for the TweensyTimeline in seconds.

Implementation
    public function get duration():Number
    public function set duration(value:Number):void
easeproperty 
public var ease:Function

Defines the ease equation you would like to use. By default this is Quintic.easeOut or the defaultTween.

See also

easeParamsproperty 
easeParams:Array  [write-only]

Sets the ease params. These params are used on Back, Bounce and Elastic ease functions.
These parameters lessen or exaggerate the effect of these particular ease functions.
i.e. [0.7] will lessen the effect of a Back equation

Implementation
    public function set easeParams(value:Array):void
finishedproperty 
finished:Boolean  [read-only]

Determines whether or not the TweensyTimeline animation has finished.

Implementation
    public function get finished():Boolean
hasTweensproperty 
hasTweens:Boolean  [read-only]

Whether the TweensyTimeline has any animations.

Implementation
    public function get hasTweens():Boolean
onCompleteproperty 
public var onComplete:Function

Executed when the TweensyTimeline animation is complete.

See also

onCompleteParamsproperty 
public var onCompleteParams:Array

Parameters applied to the onComplete Function.

See also

onRepeatproperty 
public var onRepeat:Function

Executed when the TweensyTimeline animation repeats.

See also

onRepeatParamsproperty 
public var onRepeatParams:Array

Parameters applied to the onRepeat Function.

See also

onUpdateproperty 
public var onUpdate:Function

Executed on each update to the TweensyTimeline animation.

See also

onUpdateParamsproperty 
public var onUpdateParams:Array

Parameters applied to the onUpdate Function.

See also

pausedproperty 
paused:Boolean  [read-only]

Whether the TweensyTimeline is paused.

Implementation
    public function get paused():Boolean
playingproperty 
playing:Boolean  [read-only]

This is when the animation is after the delay start and before its delay end.

Implementation
    public function get playing():Boolean
positionproperty 
position:Number  [read-write]

Seeks and returns the animation to a position from 0 to 1, start to end.

Implementation
    public function get position():Number
    public function set position(value:Number):void
repeatCountproperty 
public var repeatCount:int = 0

The count of the number of repeats which have occured.

See also

repeatEaseproperty 
public var repeatEase:Array

This contains a list of ease Functions to use on each repeat for the tween animation.
i.e. [Quintic.easeIn, Quintic.easeOut]
This will then use each of these ease Functions on each repeat.
By default this is null when this property is null this functionality is ignored.

See also

repeatsproperty 
public var repeats:int = -1

The number of repeats to use. If -1 is used then the animation will repeat indefinitely.

See also

repeatTypeproperty 
public var repeatType:String

Defines the repeat type for the animation. By default this is TweensyTimeline.NONE

Options include :

See also

snapToClosestproperty 
public var snapToClosest:Boolean = false

Whether the tweens contained within the TweensyTimeline class will snap tweened properties to the closest whole number.

timeproperty 
time:Number  [read-write]

The time in seconds the TweensyTimeline has been running for

Implementation
    public function get time():Number
    public function set time(value:Number):void
totalDurationproperty 
totalDuration:Number  [read-only]

The total duration of the TweensyTimeline animation in seconds.
This is the sum of delayStart, duration and delayEnd.

Implementation
    public function get totalDuration():Number
tweensproperty 
tweens:int  [read-only]

Number of tweens added to the TweensyTimeline Class.

Implementation
    public function get tweens():int
useSmartRotateproperty 
public var useSmartRotate:Boolean = true

Whether the timelines contained within the TweensyTimeline class will use smart rotation or not.
Smart rotation will make the rotation turn in the direction which is the shortest in degrees fixing what may otherwise appear as a visual glitch even though mathimatically it is correct.

Constructor detail
TweensyTimeline()constructor
public function TweensyTimeline()
Method detail
add()method
public function add(instance:Object, update:Object = null):AbstractTweenParameters
instance:Object
 
update:Object (default = null)

Returns
AbstractTween
clear()method 
public function clear():void

Cleans the TweensyTimeline Class ready for check in to the Object Pool for reuse.

dispose()method 
public function dispose():void

Disposes the TweensyTimeline Class instance ready for garbage collection.

from()method 
public function from(instance:Object, from:Object, update:Object = null):void

Adds a from based tween to the properties defined in the target Object.

Parameters
instance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. timeline.from([item1, item2], {x:50, y:50});
 
from:Object — An Object containing the properties you would like to tween from e.g. {x:50, y:25} or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
 
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time the tween occurs.
For example timeline.from(new DropShadowFilter(), {alpha:0}, myDisplayItem);
Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'.
fromTo()method 
public function fromTo(instance:Object, from:Object, to:Object, update:Object = null):void

Adds a from to based tween to the properties defined in the target Object.

Parameters
instance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. timeline.fromTo([item1, item2], {x:50, y:50});
 
from:Object — An Object containing the properties you would like to tween from e.g. {x:50, y:25} or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
 
to:Object — An Object containing the properties you would like to tween to e.g. {x:50, y:25} or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
 
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time the tween occurs.
For example timeline.fromTo(new DropShadowFilter(), {alpha:0}, {alpha:1}, myDisplayItem)
Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'
gc()method 
public static function gc():void

Prepares the TweensyTimeline class for garbage collection by disposing its Object Pools and making it no longer usable in the Flash application.

loop()method 
public function loop():void

Forces a timeline tween to loop the animation.
A looped animation will swap the delays (delayStart & delayEnd) so that the to and from animations have the same delays.

See also

pause()method 
public function pause():void

Pauses a playing TweensyTimeline

removeOverlap()method 
public function removeOverlap(timeline:TweensyTimeline):void

Removes tweening property tween overlaps.

Parameters
timeline:TweensyTimeline
replay()method 
public function replay():void

Plays a timeline animation at its start position on each repeat.

See also

resume()method 
public function resume():void

Resumes a paused TweensyTimeline

stop()method 
public function stop(instance:* = null, ... props):void

Allows for removing tweens via an instance or tween props by the following methods :

Parameters
instance:* (default = null)
 
... props
stopAll()method 
public function stopAll():void
to()method 
public function to(instance:Object, to:Object, update:Object = null):void

Adds a to based tween to the properties defined in the target Object.

Parameters
instance:Object — The instance Object to be tweened or multiple instances if using the type Array e.g. timeline.to([item1, item2], {x:50, y:50});
 
to:Object — An Object containing the properties you would like to tween to e.g. {x:50, y:25} or this can be relative e.g. {x:'50', y:'-25'} or can be a random position e.g. {x:'-50, 50', y:'-25, 25'}
 
update:Object (default = null) — This param is used when tweening a property in a Object which needs to be applied onto another Object each time the tween occurs.
For example timeline.to(new DropShadowFilter(), {alpha:0}, myDisplayItem);
Will apply the tweening DropShadowFilter onto the DisplayObject 'myDisplayItem'.
toString()method 
public function toString():String

Returns
String
update()method 
public function update(secs:Number):Boolean

Updates the TweensyTimeline by the specified amout of time in seconds.
This function is intended for use by the Tweensy class which is controlling this timeline animation.
Though calling this function will update the timeline independtly of the mananger allowing for custom control over timelines.

Parameters
secs:Number

Returns
Boolean — Whether the TweensyTimeline animation has finished playing.
updateTo()method 
public function updateTo(instance:Object, to:Object):void

Updates a tween for the instance Object to the new target properties defined in the to Object.

Parameters
instance:Object
 
to:Object
yoyo()method 
public function yoyo():void

Forces a timeline tween to do a yoyo animation.
A yoyo will use the same delayStart and delayEnd on the to and fro animation.

See also

Constant detail
LOOPconstant
public static const LOOP:String = "loop"

See also

NONEconstant 
public static const NONE:String = "null"

See also

REPLAYconstant 
public static const REPLAY:String = "replay"

See also

YOYOconstant 
public static const YOYO:String = "yoyo"

See also