Package | com.gskinner.motion |
Class | public class GTweenTimeline |
Inheritance | GTweenTimeline ![]() ![]() |
Property | Defined by | ||
---|---|---|---|
![]() | activeTicker : ITicker [static] The currently active Ticker object.
| GTween | |
![]() | autoPlay : Boolean = true
Indicates whether the tween should automatically play when an end value is changed.
| GTween | |
![]() | autoRotation : Boolean = false
When true, the tween will always rotate in the shortest direction to reach an end rotation value.
| GTween | |
![]() | autoVisible : Boolean = true
Indicates whether the target's visible property should automatically be set to false when its alpha value is tweened to 0 or less.
| GTween | |
currentLabel : String [read-only]
Returns the label at the current position, or the previous label irrespective of whether the tween is playing forwards or backwards.
| GTweenTimeline | ||
![]() | data : *
Allows you to associate arbitrary data with your tween.
| GTween | |
![]() | defaultEase : Function [static] Specifies the default easing function to use with new tweens.
| GTween | |
![]() | delay : Number
The length of the delay in frames or seconds (depending on the timingMode).
| GTween | |
![]() | duration : Number = 1
The length of the tween in frames or seconds (depending on the timingMode).
| GTween | |
![]() | ease : Function
The easing function to use for calculating the tween.
| GTween | |
![]() | lockStartProperties : Boolean
If set to true, this prevents the tween from reinitializing its start properties automatically (ex.
| GTween | |
![]() | nextTween : GTween
Specifies another GTween instance that will have paused=false called on it when this tween completes.
| GTween | |
![]() | pauseAll : Boolean = false [static] Setting this to true pauses all tween instances.
| GTween | |
![]() | paused : Boolean
Indicates whether the tween is currently paused.
| GTween | |
![]() | position : Number
Gets and sets the position in the tween in frames or seconds (depending on the timingMode).
| GTween | |
![]() | propertyTarget : Object
Returns the object that will have its property tweened.
| GTween | |
![]() | proxy : Object
The proxy object allows you to work with the properties and methods of the target object directly through GTween.
| GTween | |
![]() | reflect : Boolean = false
Indicates whether the tween should use the reflect mode when repeating.
| GTween | |
![]() | repeat : int = 0
The number of times this tween will repeat.
| GTween | |
![]() | reversed : Boolean
Indicates whether a tween should run in reverse.
| GTween | |
![]() | rotationProperties : Object [static] A hash table specifying properties that should be affected by autoRotation.
| GTween | |
![]() | snapping : Boolean = false
If set to true, tweened values specified by snappingProperties will be rounded (snapped) before they are assigned to the target.
| GTween | |
![]() | snappingProperties : Object [static] A hash table specifying properties that should have their value rounded (snapped) before being applied.
| GTween | |
![]() | state : String
Returns the current positional state of the tween.
| GTween | |
![]() | target : Object
The target object to tween.
| GTween | |
![]() | timeInterval : uint [static]
Sets the time in milliseconds between updates when timingMode is set to GTween.TIME ("time").
| GTween | |
![]() | timingMode : String [static]
Indicates how GTween should deal with timing.
| GTween | |
![]() | tweenPosition : Number
Returns the calculated absolute position in the tween.
| GTween |
Method | Defined by | ||
---|---|---|---|
GTweenTimeline(target:Object = null, duration:Number = 10, properties:Object = null, tweenProperties:Object = null, tweens:Array = null)
Constructs a new GTweenTimeline instance.
| GTweenTimeline | ||
addCallback(position:Number, callback:Function, parameters:Array = null):void
Adds a callback function at the specified position.
| GTweenTimeline | ||
addLabel(position:Number, label:String):void
Adds a label at the specified position.
| GTweenTimeline | ||
Adds a tween to the timeline, which will start playing at the specified start position.
| GTweenTimeline | ||
addTweens(tweens:Array):void
Shortcut method for adding a number of tweens at once.
| GTweenTimeline | ||
![]() |
beginning():void
Jumps the tween to its beginning.
| GTween | |
calculateDuration():void
Calculates the duration of the timeline based on the tweens and callbacks that have been added to it.
| GTweenTimeline | ||
![]() |
deleteProperty(name:String):Boolean
Removes a end value from the tween.
| GTween | |
![]() |
end():void
Jumps the tween to its end.
| GTween | |
![]() |
getProperties():Object
Returns the hash table of all end properties and their values.
| GTween | |
![]() |
getProperty(name:String):Number
Returns the end value for the specified property if one exists.
| GTween | |
![]() |
getStartProperties():Object
Returns the hash table of all start properties and their values.
| GTween | |
goto(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position without affecting its paused state.
| GTweenTimeline | ||
gotoAndPlay(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position and plays it.
| GTweenTimeline | ||
gotoAndStop(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position and pauses it.
| GTweenTimeline | ||
![]() |
invalidate():void
Invalidate forces the tween to repopulate all of the initial properties from the target object, and start playing if autoplay is set to true.
| GTween | |
![]() |
linearEase(t:Number, b:Number, c:Number, d:Number):Number
[static] The default easing function used by GTween.
| GTween | |
![]() |
pause():void
Pauses the tween by stopping tick from being automatically called.
| GTween | |
![]() |
play():void
Plays a tween by incrementing the position property each frame.
| GTween | |
removeCallback(position:Number):void
Removes the callback at the specified position.
| GTweenTimeline | ||
removeLabel(label:String):void
Removes the specified label.
| GTweenTimeline | ||
removeTween(tween:GTween):void
Removes the specified tween.
| GTweenTimeline | ||
![]() |
reverse(suppressEvents:Boolean = true):void
Toggles the reversed property and inverts the current tween position.
| GTween | |
![]() |
setAssignment(assignmentTarget:Object = null, assignmentProperty:String = null):void
Allows you to tween objects that require re-assignment whenever they are modified by reassigning the target object to a specified property of another
object.
| GTween | |
setPosition(value:Number, suppressEvents:Boolean = true):void
| GTweenTimeline | ||
![]() |
setProperties(properties:Object):void
Shorthand method for making multiple setProperty calls quickly.
| GTween | |
![]() |
setProperty(name:String, value:Number):void
Sets the numeric end value for a property on the target object that you would like to tween.
| GTween | |
setPropertyValue(target:Object, propertyName:String, value:*):void
[static]
Sets a property value on a specified target object.
| GTweenTimeline | ||
![]() |
setStartProperties(properties:Object):void
Allows you to manually assign the start property values for a tween.
| GTween | |
![]() |
setTweenProperties(properties:Object):void
Shortcut method for setting multiple properties on the tween instance quickly.
| GTween |
currentLabel | property |
currentLabel:String
[read-only]
Returns the label at the current position, or the previous label irrespective of whether the tween is playing forwards or backwards. For example,
if there are labels at 2, 4, and 7, and the current position is 6, the currentLabel
will be the label at position 4.
public function get currentLabel():String
GTweenTimeline | () | constructor |
public function GTweenTimeline(target:Object = null, duration:Number = 10, properties:Object = null, tweenProperties:Object = null, tweens:Array = null)
Constructs a new GTweenTimeline instance.
Parameterstarget:Object (default = null ) — The object whose properties will be tweened. Defaults to null.
|
|
duration:Number (default = 10 ) — The length of the tween in frames or seconds depending on the timingMode. Defaults to 10.
|
|
properties:Object (default = null ) — An object containing destination property values. For example, to tween to x=100, y=100, you could pass {x:100, y:100} as the props object.
|
|
tweenProperties:Object (default = null ) — An object containing properties to set on this tween. For example, you could pass {ease:myEase} to set the ease property of the new instance. This also provides a shortcut for setting up event listeners. See .setTweenProperties() for more information.
|
|
tweens:Array (default = null ) — An array of alternating start positions and tween instances. For example, the following array would add 3 tweens starting at positions 2, 6, and 8: [2, tween1, 6, tween2, 8, tween3]
|
addCallback | () | method |
public function addCallback(position:Number, callback:Function, parameters:Array = null):void
Adds a callback function at the specified position. When the timeline's playhead passes over or lands on the position while playing
the callback will be called with the parameters specified. Callbacks will not be called when manually adjusting the position using the position
property (see position for more information).
Note that this can be used in conjunction with the static setPropertyValue
method to easily set properties on objects in the timeline.
position:Number — The position to add the callback at in frames or seconds (as per the timing mode of this tween).
|
|
callback:Function — The function to call.
|
|
parameters:Array (default = null ) — Optional array of parameters to pass to the callback when it is called.
|
addLabel | () | method |
public function addLabel(position:Number, label:String):void
Adds a label at the specified position. You can use gotoAndPlay
or gotoAndStop
to jump to labels you add,
or use currentLabel
to check what the last label you passed was.
position:Number — The position to add the label at in frames or seconds (as per the timing mode of this tween).
|
|
label:String — The label to add.
|
addTween | () | method |
public function addTween(startPosition:Number, tween:GTween):void
Adds a tween to the timeline, which will start playing at the specified start position.
The tween will play synchronized with the timeline, with all of its behaviours intact (ex. reversed
, repeat
, reflect
)
except for delay
(which is accomplished with the startPosition
parameter instead).
startPosition:Number — The starting position for this tween in frames or seconds (as per the timing mode of this tween).
|
|
tween:GTween — The GTween instance to add. Note that this can be any subclass of GTween, including another GTweenTimeline.
|
addTweens | () | method |
public function addTweens(tweens:Array):void
Shortcut method for adding a number of tweens at once.
Parameterstweens:Array — An array of alternating start positions and tween instances. For example, the following array would add 3 tweens starting at positions 2, 6, and 8: [2, tween1, 6, tween2, 8, tween3]
|
calculateDuration | () | method |
public function calculateDuration():void
Calculates the duration of the timeline based on the tweens and callbacks that have been added to it.
goto | () | method |
public function goto(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position without affecting its paused state.
ParameterslabelOrPosition:* — The label name or numeric position in frames or seconds (as per the timing mode of this tween) to jump to.
|
gotoAndPlay | () | method |
public function gotoAndPlay(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position and plays it.
ParameterslabelOrPosition:* — The label name or numeric position in frames or seconds (as per the timing mode of this tween) to jump to.
|
gotoAndStop | () | method |
public function gotoAndStop(labelOrPosition:*):void
Jumps the timeline to the specified label or numeric position and pauses it.
ParameterslabelOrPosition:* — The label name or numeric position in frames or seconds (as per the timing mode of this tween) to jump to.
|
removeCallback | () | method |
public function removeCallback(position:Number):void
Removes the callback at the specified position.
Parametersposition:Number — The position of the callback to remove in frames or seconds (as per the timing mode of this tween).
|
removeLabel | () | method |
public function removeLabel(label:String):void
Removes the specified label.
Parameterslabel:String — The label to remove.
|
removeTween | () | method |
public function removeTween(tween:GTween):void
Removes the specified tween. Note that this will remove all instances of the tween if has been added multiple times to the timeline.
Parameterstween:GTween — The GTween instance to remove.
|
setPosition | () | method |
public override function setPosition(value:Number, suppressEvents:Boolean = true):void
Parameters
value:Number |
|
suppressEvents:Boolean (default = true )
|
setPropertyValue | () | method |
public static function setPropertyValue(target:Object, propertyName:String, value:*):void
Sets a property value on a specified target object. This is provided to make it easy to set properties
in a GTweenTimeline using addCallback
. For example, to set the visible
property to true on a movieclip "foo"
at 3 seconds into the timeline, you could use the following code:
myTimeline.addCallback(3,GTweenTimeline.setPropertyValue,[foo,"visible",true]);
target:Object — The object to set the property value on.
|
|
propertyName:String — The name of the property to set.
|
|
value:* — The value to assign to the property.
|