Class Tween extends Component

A tweening component.

Methods

Tween(values, duration, properties, plugins) constructor

Creates new instance of Tween Component.

Parameters
values : Object — The values to tween.
duration : number — Duraction in seconds.
properties : Object | null — Tween properties Object.
plugins : Object | null — Interpolation plugins object
play() method
Starts tweening.
stop() method
Stops current tween.
reset() method
Resets current tween.
to(values, duration) method

Sets the values for tweening.

Parameters
values : Object — Values to tween.
duration : number — Duration in seconds.
Returns
Tween — Returns this.
pause() method
Pauses current tween.
chain() method
Add specified tween object into the queue. The specified tween will be executed after completion of this tween,
set(values) method

Updates tween values.

Parameters
values : Object — The Object to get values from.
Returns
void
reverse(asYoyo) method

Switches end values with start values.

Parameters
asYoyo : boolean — Indicates wether easing function should be also reversed.
Returns
Tween — Returns this.

Inherited Methods

onAdded(gameObject) inherited method

Called when attached to GameObject.

Parameters
gameObject : GameObject — The owner of this component.
Returns
void
onRemoved(gameObject) inherited method

Called when detached from GameObject.

Parameters
gameObject : GameObject — The owner of this component.
Returns
void
onUpdate() inherited method
Called at every update.
onRender() inherited method
Called after all updates have been executed but before DisplayObject's onRender. GameObject itself does not have onRender method so Component#onRender will not be called on GameObjects.
This method can be used to interpolate/extrapolate values when low Black#ups value is used.
removeFromParent() inherited method
Detaches this Component from its parent GameObject.

Properties

mProperties[undefined] property

ease : function property
Sets/Gets active ease function.
interpolation : function property
Sets/Gets the interpolation algorithm. Possible values Interpolation.linear, Interpolation.bezier, Interpolation.catmullRom or your custom function.
elapsed : number property
Time elapsed since tween start in seconds.
delay : number property
Sets/Gets amount of seconds to wait before tweening.
repeats : number property
Gets/Sets the number of times the tween will be repeated after first execution.
repeatDelay : number property
Sets/Gets amount of seconds to wait between repeats.
loop : boolean property
Gets/Sets if tween should be looped over.
yoyo : boolean property
Enables/disables reversing between repeats.
reversed : boolean property
Enables/disables reversed playback on start.
removeOnComplete : boolean property
Sets/Gets whether the Tween Component should be automatically detached from owner GameObject after completion.
playOnAdded : boolean property
Sets/Gets whether the tween should start playing automatically when added to the root.
plugins : Object property
Sets/Gets optional object with custom interpolation handler function for specific target properties.
duration : number property
Gets this tween duration.
isPlaying : boolean property
Indicated whether the tween is playing and not paused.
mValuesStart[undefined] property

mValues[undefined] property

mValuesStart[undefined] property

mValues[undefined] property

defaultEase : function static property
Ease to be used in all tweens, if another ease is not specified. Ease.smootherStep is used.

Inherited Properties

gameObject : GameObject inherited property
Returns owner of this component.
parent : GameObject | null inherited property
Returns this Component owner GameObject.
stage : Stage | null inherited property
Returns the stage Game Object to which this component belongs to or null if not on the stage.
path : string | null inherited property
Returns string representing a url like path to this object in the display tree.

Messages

start message
Posted when tween started.
update message
Posted on every tween update.
Note: tween can update object values inside onRender method without posting Tween#update message.
loop message
Posted everytime tween is repeating.
complete message
Posten when tween is finished.