Adobe Animate/CreateJS - this.myMovieClip.stop(); not working - no error in console

。_饼干妹妹 提交于 2019-12-13 20:27:15

问题


I'm just getting started in Adobe Animate/CreateJS. I'm trying to control the timeline of a movie clip ("myMovieClip") on frame 1 on the main stage, preventing it from playing. According to the documentation, this should work:

this.myMovieClip.stop();

But it does not... the movie "myMovieClip" clip plays immediately on test in the browser, and I'm not getting any error love from the console. It's as if the above line of code wasn't even there.

This seems pretty basic. What am I missing? I ultimately want to stop all movie clips on the main timeline as well as a large group of nested ones. If there's a single command that does this, I'd love to hear about it.


回答1:


I am fairly certain this is related to a bug in the Adobe Animate output that makes MovieClip timelines not immediately available.

You can get around this by forcing an update before you try to access the children:

this.gotoAndStop(0); // Forces update
this.myMovieClip.stop();

Hope that helps!



来源:https://stackoverflow.com/questions/56484728/adobe-animate-createjs-this-mymovieclip-stop-not-working-no-error-in-cons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!