onErrorScope

Availability

AS2 and AS3.

Usage

... onErrorScope:value, ...

Parameters

value:Object — The object in which the onError function will be executed. This is needed if you have some specialized code inside the event function; in that case, references to this. inside the function will reference to the object defined by this parameter. If omitted, the tweened object is the scope used instead.

Examples

// Run an event on an object, and output the scope in which the event is being executed, IF there's an error
// Output: "Error! _level0.box", the tweened object itself, IF there's an error
Tweener.addTween(this.box, {_x:100, time:1, onComplete:function() { trace ("Error! " + this); }});
// Output: "Error! _level0", the scope from which the tween was started, IF there's an error
Tweener.addTween(this.box, {_y:100, time:1, onComplete:function() { trace ("Error! " + this); }, onCompleteScope:this});

See also

onError