Packagecom.greensock.core
Classpublic class TweenCore
SubclassesSimpleTimeline, TweenLite

TweenCore is the base class for all TweenLite, TweenMax, TimelineLite, and TimelineMax classes and provides core functionality and properties. There is no reason to use this class directly.

Copyright 2009, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.



Public Properties
 PropertyDefined by
  currentTime : Number
Most recently rendered time (or frame for frames-based tweens/timelines) according to its duration.
TweenCore
  data : *
Place to store any data you want.
TweenCore
  delay : Number
Length of time in seconds (or frames for frames-based tweens/timelines) before the tween should begin.
TweenCore
  duration : Number
Duration of the tween in seconds (or frames for frames-based tweens/timelines) not including any repeats or repeatDelays.
TweenCore
  paused : Boolean
Indicates the paused state of the tween/timeline.
TweenCore
  reversed : Boolean
Indicates the reversed state of the tween/timeline.
TweenCore
  startTime : Number
Start time in seconds (or frames for frames-based tweens/timelines), according to its position on its parent timeline
TweenCore
  timeline : SimpleTimeline
The parent timeline on which the tween/timeline is placed.
TweenCore
  totalDuration : Number
Duration of the tween in seconds (or frames for frames-based tweens/timelines) including any repeats or repeatDelays (which are only available on TweenMax and TimelineMax).
TweenCore
  totalTime : Number
Most recently rendered time (or frame for frames-based tweens/timelines) according to its totalDuration.
TweenCore
  vars : Object
Stores variables (things like alpha, y or whatever we're tweening as well as special properties like "onComplete").
TweenCore
Public Methods
 MethodDefined by
  
TweenCore(duration:Number = 0, vars:Object = null)
TweenCore
  
complete(skipRender:Boolean = false, suppressEvents:Boolean = false):void
Forces the tween/timeline to completion.
TweenCore
  
invalidate():void
Clears any initialization data (like starting values in tweens) which can be useful if, for example, you want to restart it without reverting to any previously recorded starting values.
TweenCore
  
kill():void
Kills the tween/timeline, stopping it immediately.
TweenCore
  
pause():void
Pauses the tween/timeline
TweenCore
  
play():void
Starts playing forward from the current position.
TweenCore
  
restart(includeDelay:Boolean = false, suppressEvents:Boolean = true):void
Restarts and begins playing forward.
TweenCore
  
resume():void
Starts playing from the current position without altering direction (forward or reversed).
TweenCore
  
reverse(forceResume:Boolean = true):void
Reverses smoothly, adjusting the startTime to avoid any skipping.
TweenCore
Property detail
currentTimeproperty
currentTime:Number  [read-write]

Most recently rendered time (or frame for frames-based tweens/timelines) according to its duration. totalTime, by contrast, is based on its totalDuration which includes repeats and repeatDelays. Since TweenLite and TimelineLite don't offer repeat and repeatDelay functionality, currentTime and totalTime will always be the same but in TweenMax or TimelineMax, they could be different. For example, if a TimelineMax instance has a duration of 5 a repeat of 1 (meaning its totalDuration is 10), at the end of the second cycle, currentTime would be 5 whereas totalTime would be 10. If you tracked both properties over the course of the tween, you'd see currentTime go from 0 to 5 twice (one for each cycle) in the same time it takes totalTime go from 0 to 10.

Implementation
    public function get currentTime():Number
    public function set currentTime(value:Number):void
dataproperty 
public var data:*

Place to store any data you want.

delayproperty 
delay:Number  [read-write]

Length of time in seconds (or frames for frames-based tweens/timelines) before the tween should begin. The tween's starting values are not determined until after the delay has expired (except in from() tweens)

Implementation
    public function get delay():Number
    public function set delay(value:Number):void
durationproperty 
duration:Number  [read-write]

Duration of the tween in seconds (or frames for frames-based tweens/timelines) not including any repeats or repeatDelays. totalDuration, by contrast, does include repeats and repeatDelays.

Implementation
    public function get duration():Number
    public function set duration(value:Number):void
pausedproperty 
paused:Boolean  [read-write]

Indicates the paused state of the tween/timeline. This does not take into account anscestor timelines. So for example, a tween that is not paused might appear paused if its parent timeline (or any ancenstor timeline) is paused.

Implementation
    public function get paused():Boolean
    public function set paused(value:Boolean):void
reversedproperty 
reversed:Boolean  [read-write]

Indicates the reversed state of the tween/timeline. This value is not affected by yoyo repeats and it does not take into account the reversed state of anscestor timelines. So for example, a tween that is not reversed might appear reversed if its parent timeline (or any ancenstor timeline) is reversed.

Implementation
    public function get reversed():Boolean
    public function set reversed(value:Boolean):void
startTimeproperty 
startTime:Number  [read-write]

Start time in seconds (or frames for frames-based tweens/timelines), according to its position on its parent timeline

Implementation
    public function get startTime():Number
    public function set startTime(value:Number):void
timelineproperty 
public var timeline:SimpleTimeline

The parent timeline on which the tween/timeline is placed. By default, it uses the TweenLite.rootTimeline (or TweenLite.rootFramesTimeline for frames-based tweens/timelines).

totalDurationproperty 
totalDuration:Number  [read-write]

Duration of the tween in seconds (or frames for frames-based tweens/timelines) including any repeats or repeatDelays (which are only available on TweenMax and TimelineMax). duration, by contrast, does NOT include repeats and repeatDelays. So if a TweenMax's duration is 1 and it has a repeat of 2, the totalDuration would be 3.

Implementation
    public function get totalDuration():Number
    public function set totalDuration(value:Number):void
totalTimeproperty 
totalTime:Number  [read-write]

Most recently rendered time (or frame for frames-based tweens/timelines) according to its totalDuration. currentTime, by contrast, is based on its duration which does NOT include repeats and repeatDelays. Since TweenLite and TimelineLite don't offer repeat and repeatDelay functionality, currentTime and totalTime will always be the same but in TweenMax or TimelineMax, they could be different. For example, if a TimelineMax instance has a duration of 5 a repeat of 1 (meaning its totalDuration is 10), at the end of the second cycle, currentTime would be 5 whereas totalTime would be 10. If you tracked both properties over the course of the tween, you'd see currentTime go from 0 to 5 twice (one for each cycle) in the same time it takes totalTime go from 0 to 10.

Implementation
    public function get totalTime():Number
    public function set totalTime(value:Number):void
varsproperty 
public var vars:Object

Stores variables (things like alpha, y or whatever we're tweening as well as special properties like "onComplete").

Constructor detail
TweenCore()constructor
public function TweenCore(duration:Number = 0, vars:Object = null)Parameters
duration:Number (default = 0)
 
vars:Object (default = null)
Method detail
complete()method
public function complete(skipRender:Boolean = false, suppressEvents:Boolean = false):void

Forces the tween/timeline to completion.

Parameters
skipRender:Boolean (default = false) — to skip rendering the final state of the tween, set skipRender to true.
 
suppressEvents:Boolean (default = false) — If true, no events or callbacks will be triggered for this render (like onComplete, onUpdate, onReverseComplete, etc.)
invalidate()method 
public function invalidate():void

Clears any initialization data (like starting values in tweens) which can be useful if, for example, you want to restart it without reverting to any previously recorded starting values. When you invalidate() a tween/timeline, it will be re-initialized the next time it renders and its vars object will be re-parsed. The timing of the tween/timeline (duration, startTime, delay) will NOT be affected. Another example would be if you have a TweenMax(mc, 1, {x:100, y:100}) that ran when mc.x and mc.y were initially at 0, but now mc.x and mc.y are 200 and you want them tween to 100 again, you could simply invalidate() the tween and restart() it. Without invalidating first, restarting it would cause the values jump back to 0 immediately (where they started when the tween originally began). When you invalidate a timeline, it automatically invalidates all of its children.

kill()method 
public function kill():void

Kills the tween/timeline, stopping it immediately.

pause()method 
public function pause():void

Pauses the tween/timeline

play()method 
public function play():void

Starts playing forward from the current position. (essentially unpauses and makes sure that it is not reversed)

restart()method 
public function restart(includeDelay:Boolean = false, suppressEvents:Boolean = true):void

Restarts and begins playing forward.

Parameters
includeDelay:Boolean (default = false) — Determines whether or not the delay (if any) is honored in the restart()
 
suppressEvents:Boolean (default = true) — If true, no events or callbacks will be triggered as the "virtual playhead" moves to the new position (onComplete, onUpdate, onReverseComplete, etc. of this tween/timeline and any of its child tweens/timelines won't be triggered, nor will any of the associated events be dispatched)
resume()method 
public function resume():void

Starts playing from the current position without altering direction (forward or reversed).

reverse()method 
public function reverse(forceResume:Boolean = true):void

Reverses smoothly, adjusting the startTime to avoid any skipping. After being reversed, it will play backwards, exactly opposite from its forward orientation, meaning that, for example, a tween's easing equation will appear reversed as well. If a tween/timeline plays for 2 seconds and gets reversed, it will play for another 2 seconds to return to the beginning.

Parameters
forceResume:Boolean (default = true) — If true, it will resume() immediately upon reversing. Otherwise its paused state will remain unchanged.