Canvas executes movieclip frame actions in reverse?
I thought the Animate change that makes single-frame movieclip code only execute once was bad, but this is so bad I'm half-convinced I must be hallucinating it.
Okay, in an HTML5 Canvas document, say you have a movieclip with 5 frames, and on each frame there's "console.log(1);", then "console.log(2);" etc up to "5" and a "this.stop(); "on the fifth frame. Oh and there's like a red ball or something to make it visible.
Now put this movieclip on the root timeline. Say, 10 frames long. Drop an F7 blank keyframe on the last frame so when the main timeline loops the movieclip will be removed from and re-added to the display list.
Finally, run it and open the browser's developer console. This is what you'll see:
1
2
3
4
5
4
3
2
1
...over and over for as long as you let it run. Every time the movieclip is re-added to the display list, something in CreateJS is apparently rewinding the movieclip to its first frame and for some insane reason executing every frame action along the way. So the 4, 3, 2, 1 appears all at once, then the 2, 3, 4, 5 trickles out one frame at a time.
This is of course absolutely bonkers, and is guaranteed to mess up any multiframe movieclip that's expecting its frame code to execute in a particular order.
Anyone know how to work around this? I've tried some contortions with this.gotoAndStop(0) and this.actionsEnabled = true/false, but so far nothing was worked quite right.
