[Tweener] update applied to undefined objects(scope) : bug or feature?

Arthur Debert arthur at stimuli.com.br
Fri Mar 9 05:04:29 PST 2007


Hi Folks.

Yesterday I came across an issue with tweener that I hadn't noticed so far.
If you create a tween on an object and then remove (delete) the object, the
tween will still run on it.

<code>
// we have a _mc movie clip on this scope
_mc._alpha = 100;
Tweener.addTween(_mc, { _alpha: 0, time: 4, onUpdate: function(){
trace(this)}});
_mc.removeMovieClip();
</code>

In this case, the tween will still run, even though it's target will be
undefined. This definitely seems like a bug to me, specially since like
orphan setIntervals, there's no way to remove them (how can I call
Tweener.removeTweens() with no _mc ?).



The culprit is on updateTweenByIndex. It checks to see if there is a tween
object, but does not check the scope.
On trunk (rev. 164) ~line 555 where it says:
<code>
if (tTweening == null) return false;
</code>

it should say:
<code>
if (tTweening == null || !tTweening.scope) return false;
</code>

If it's a bug, I have a patch ready, and will put set up a new ticket
today.
Am I overlooking something, or is it really a bug?

Cheers
Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20070309/1771e2d9/attachment.html 


More information about the tweener mailing list