gskinner/TweenJS — pull request #7 by iwo (2012-04-01 17:33:54+00:00)
Title: Timeline pausing issue

If Timeline is created with the code below it is impossible to pause it.

timeline = new Timeline();
timeline.addTween(tween1);
timeline.addTween(tween2);
timeline.gotoAndPlay(0);

timeline.setPaused(true); //doesn't work

This is caused by the timeline being registered in Tween._register() twice, so subsequent unregistering unregisters only one reference from the Tween._tweens array. To prevent this I modified Timeline and Tween constructors to use setPaused() internally. This ensures that _paused flag always indicates if Timeline/Tween is registered with Tween._register().

Let me know what you think.

Cheers,
Iwo Banas