[static] A function that should be called when any tween gets overwritten by another tween (great for debugging). The following parameters will be passed to that function:
- overwrittenTween : Animation - the tween that was just overwritten
- overwritingTween : Animation - the tween did the overwriting
- target : Object [only passed if the overwrite mode was
"auto"
because that's the only case when portions of a tween can be overwritten rather than the entire thing] - the target object whose properties were overwritten. This is usually the same asoverwrittenTween.target
unless that's an array and the overwriting targeted a sub-element of that array. For example,TweenLite.to([obj1, obj2], 1, {x:100})
and thenTweenLite.to(obj2, 1, {x:50})
, thetarget
would beobj2
. - overwrittenProperties : Array [only passed if the overwrite mode was
"auto"
because that's the only case when portions of a tween can be overwritten rather than the entire thing] - an array of property names that were overwritten, like["x","y","opacity"]
.
Note: there is also an onOverwrite
special property that you can apply on a tween-by-tween basis like TweenLite.to(... {x:100, onOverwrite:yourFunction}).
See it in action
Run this TweenLite.onOverwrite demo with the browser console open to see the info that gets reported when an overwrite occurs.