class ZManager extends ObjectDocumentation explains engine events. Class is private to engine but code documents methods & properties.
Usage:
Engine events: ZigoEngine.doTween allows for automated callbacks. In most cases, callbacks are ideal because only one targeted function-call is needed. But in situations where a tween's state-change might need to be heard by a number of listener scopes, events can be more flexible.
Subscribing to these events differs based on whether you used ZigoEngine.register or ZigoEngine.simpleSetup. In the following example you would skip the ZigoEngine.initialize step if simpleSetup was used. (Otherwise you need to initialize targets so they are able to accept listeners prior to tweening.)
var myListener:Object = {
onTweenStart:function(o:Object):Void {
trace("Tween started on:"+o.target._name+" ["+o.props.toString()+"]");
},
onTweenUpdate:function(o:Object):Void {
trace("Tween updating on:"+o.target._name+" ["+o.props.toString()+"]");
},
onTweenEnd:function(o:Object):Void {
trace("Tween completed on:"+o.target._name+" ["+o.props.toString()+"]");
}
};
// if simpleSetup was not used, initialize targets first to accept listeners
ZigoEngine.initialize(clip1, clip2);
clip1.addListener(myListener);
clip2.addListener(myListener);
ZigoEngine.doTween(clip1,"_alpha",0,2);
ZigoEngine.doTween(clip2,"_scale",200,2);
The event object passed contains {target:Object, props:Array}. This object can be crucial since ZigoEngine uses the older AsBroadcaster event model, which does not distinguish event type.
Author:
Moses Gunesch / MosesSupposes.com
Version:
2.1
The documentation was generated from the following file:
ZigoEngine.doTween allows for automated callbacks. In most cases, callbacks are ideal because only one targeted function-call is needed. But in situations where a tween's state-change might need to be heard by a number of listener scopes, events can be more flexible.
Events dispatched by ZigoEngine (see ZigoEngine.addListener for more info):
onTweenAdd
onTweenInterrupt
onTweenStart
onTweenUpdate
onTweenEnd
Subscribing to these events differs based on whether you used ZigoEngine.register or ZigoEngine.simpleSetup. In the following example you would skip the
ZigoEngine.initialize
step ifsimpleSetup
was used. (Otherwise you need to initialize targets so they are able to accept listeners prior to tweening.)The event object passed contains
{target:Object, props:Array}
.This object can be crucial since ZigoEngine uses the older AsBroadcaster event model, which does not distinguish event type.