Adobe Animate / CreateJS-this.myMovieClip.stop();不起作用-控制台中没有错误 [英] Adobe Animate/CreateJS - this.myMovieClip.stop(); not working - no error in console

查看:92
本文介绍了Adobe Animate / CreateJS-this.myMovieClip.stop();不起作用-控制台中没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Adobe Animate / CreateJS。我试图控制主舞台第1帧上的影片剪辑( myMovieClip)的时间轴,以防止其播放。根据文档,这应该可行:



this.myMovieClip.stop();



但是不是...电影 myMovieClip剪辑会立即在浏览器中测试播放,并且我没有从控制台收到任何错误提示。好像上面的代码行根本没有。



这似乎很基本。我想念什么?我最终希望停止主时间轴上的所有影片剪辑以及大量嵌套的影片剪辑。如果只有一个命令可以执行此操作,那么我很想听听它。

解决方案

我相当确定这是相关的



您可以通过在尝试访问子级之前强制进行更新来解决此问题:





  this.gotoAndStop(0); //强制更新
this.myMovieClip.stop();

希望有帮助!


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.

解决方案

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!

这篇关于Adobe Animate / CreateJS-this.myMovieClip.stop();不起作用-控制台中没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆