-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tween chain never completes #1871
Comments
One workaround: FlxTween.tween(fakeThing, { c: 1 }, 1, { onComplete:function (dummy:FlxTween) {
FlxTween.num(0, 1).then(FlxTween.num(0, 1, 1, { onComplete: function (dummy:FlxTween) {
trace("done C");
}}));
}}); This traces properly, and after 3 seconds. |
Chaining simply didn't account for nested chains... I hope it works as expected now. Writing the unit tests for this one was fun. :D |
Huh...I'll have to try it out, but that's interesting, because in the above example, it does work with nested chains, just not 3 levels, for some reason...2 worked fine. But I also wonder, do I have the chaining syntax incorrect? Is it supposed to be .then(tween).then() instead of .then(tween.then()) in normal usage? For some reason I thought I had either tried that or traced it and thought it needed to be nested to work. I thought because .then() returned the original tween, so originalTween.then(tweenA).then(tweenB) would start A and B simultaneously after original finished. |
The
|
You're right! I could've sworn I tried that. Maybe I got confused because I was trying to finish with |
Code snippet reproducing the issue:
Observed behavior:
done B
not tracedExpected behavior:
done B
should be tracedI realize the two things are not semantically equivalent, but they should both call their completion functions, shouldn't they? The first one should tween, trace, num, num (tracing after 1 second); the second should tween, num, num, trace (tracing after 3 seconds). But the second one never traces. (And of course, this is the one you'd expect from a general concept of chaining.)
Take out a num tween, or take away the tween tween, and they both trace as expected.
The text was updated successfully, but these errors were encountered: