Skip to content
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

Movieclip autoReset causes frame actions to be executed in reverse order when movieclip is reset #114

Open
uhalliwell opened this issue Jun 7, 2023 · 0 comments

Comments

@uhalliwell
Copy link

Under CreateJS 1.0.0, when a multiframe movieclip is present on the stage (with autoReset in the default TRUE state), then removed, then added again, the reset behavior causes all the movieclip's frame actions to be executed in reverse order from its current frame, which is clearly not desirable, and was not the default behavior under CJS 2015.

Note that I'm working in the Adobe Animate environment, but based on my investigation this seems to be an issue with TweenJS instead of anything Adobe's layered on top of it.

For example, say you have a five-frame movieclip, with an action on frame 1 of "console.log(1);", then "console.log(2);" on the next frame, etc., with an added "this.stop();" on the last frame. Then place this movieclip on a root timeline with enough frames for the movieclip to fully play, and a blank keyframe at the end so the movieclip will be removed from and re-added to the stage when the root timeline loops. What you'll see in the console is: 1, 2, 3, 4, 5, 4, 3, 2, 1... repeating. The 4, 3, 2, 1, spews all at once within a single tick.

In AbstractTween.js, p._runActions(), around line 533, I added this line of code after "if (jump)...":
else if (t0 > t1 && !this.reversed) { return this._runActionsRange(t1, t1, jump, true); }

This seems to fix the problem, though TweenJS has to handle so many edge cases I doubt this is a proper fix. I'd imagine having the reset() method set a flag would be preferable.

Details: Adobe Animate 23 (Build 103), Windows 11, all browsers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant