Class com.thelab.tween.Litr

com.thelab.tween.Litr

Description

Tweening Class for Flash Animations. Create cool effects por your MovieClips or Objects properties.

Field Index

_filterQuality, _motorOff, _motorOn, _running, TW_BY_ID, TW_BY_INDEX, TW_BY_OBJECT, TW_BY_TIME

Method Index

addEventListener(), callEvent(), init(), kill(), killAll(), killProperty(), pause(), pauseAll(), tween(), unpause()

Field Detail

TW_BY_TIME

static TW_BY_TIME:Number
Constant Parameter for searching in Search, Pause, Kill,... routines. Searches for a tween running more time than the passed parameter.

TW_BY_ID

static TW_BY_ID:Number
Constant Parameter for searching in Search, Pause, Kill,... routines. Searchs for the tween with the desired Id

TW_BY_OBJECT

static TW_BY_OBJECT:Number
Constant Parameter for searching in Search, Pause, Kill,... routines. Searches for a tween that has as target a specified Object

TW_BY_INDEX

static TW_BY_INDEX:Number
Constant Parameter for searching in Search, Pause, Kill,... routines. Searches for a tween with the specified index. (Caution use this only if you're certain where in the Tweening list the tween is.

_filterQuality

static _filterQuality
Get/Set the overall filter quality for TweenFx tweens.

_running

static _running:Number [Read Only]
Returns the current Number of Running Tweens

_motorOn

static _motorOn:Number [Read Only]
Returns the Number of Motors currently working (aka with the onEnterFrame callback != undefined.

_motorOff

static _motorOff:Number [Read Only]
Returns the Number of Motors currently idle (aka with the onEnterFrame callback == undefined.

Method Detail

init

static function init(max_tween:Number, motor_count:Number)

Initialize the Litr Class with the configuration necessary to create it's internal structures. Balance the limit of Tweenings with the Number of Motors in order to achieve a good performance.

Parameters

max_tweenLimit of simultaneous tweening that the internal structures will bare.
motor_countNumber of Motor that will work simultaneously to execute each tweening.

addEventListener

static function addEventListener(ev_name:String, callback:Function):Boolean

Register the callback passed as parameter into the callback list. It'll be called when the desired callback occurs.

Parameters

ev_nameName of the event. In ver. 1.0 the current callbacks are (start,update,complete).
callbackReference for the callback function.

Return

Boolean - Flag indicating if the register was made correctly.

callEvent

static function callEvent(ev_name:String, tween_node:TweenNode):Boolean

Call an event of the Litr, a TweenNode is passed in order to know wich tween invoked the event.

Parameters

ev_nameName of the event.
tween_nodeTweenNode that invoked the event.

Return

Boolean - Flag indicating if all callbacks were invoked correctly.

tween

static function tween(target, command, param):Array

Creates a tween and insert it in the execution list.

Parameters

targetObject that will have it's properties modified.
commandString or an Array of Strings with the tweening parameters and properties to be changed.
paramParam passed to the ending callback invked when the tween ended.

Return

Array - List with all TweenNodes id that were created. Use them as parameter to find each created tween and kill,pause,unpause,... it.

kill

static function kill(param, target:Number):Boolean

Remove a TweenNode from the execution list according to some criteria.

Parameters

paramTweenNode Selection parameter
targetSearch Criteria. The possible values are TW_BY_TIME,TW_BY_OBJECT,TW_BY_ID,TW_BY_INDEX.

Return

Boolean - Flag indicating if the Tween was successfully killed.

killAll

static function killAll()

Removes All Tweens from the Tweening List from all Motors.

pauseAll

static function pauseAll()

Pauses All Tweens from the Tweening List from all Motors.

pause

static function pause(param, target:Number):Boolean

Pause a Tweening from the execution list according to some criteria.

Parameters

paramTweenNode Selection parameter
targetSearch Criteria. The possible values are TW_BY_TIME,TW_BY_OBJECT,TW_BY_ID,TW_BY_INDEX.

Return

Boolean - Flag indicating if the Tween was successfully paused.

unpause

static function unpause(param, target:Number):Boolean

Unpause a Tweening from the execution list according to some criteria.

Parameters

paramTweenNode Selection parameter
targetSearch Criteria. The possible values are TW_BY_TIME,TW_BY_OBJECT,TW_BY_ID,TW_BY_INDEX.

Return

Boolean - Flag indicating if the Tween was successfully unpaused.

killProperty

static function killProperty(prop:String, node_id:Number)

Searches for some property being tweened in the moment and delete that.

Parameters

propProperty name.
node_idId of the tween node that it is contained.