AS3如何正确播放MovieClips
我在某个帧上使用 AS3,如果我调用某个 MovieClip 的实例名称“guy”,它将启动该 MovieClip 的父级,而不是它本身。
MovieClip(root).guy.play();
如果我尝试玩(); “guy”的子级:
MovieClip(root).guy.feet1.play();
它会说 foot1 未定义。
有什么建议吗?
I'm using AS3 on a certain frame, If I call the instance name "guy" of some MovieClip it will start the parent of that MovieClip, and not itself.
MovieClip(root).guy.play();
If I try to play(); a child of "guy":
MovieClip(root).guy.feet1.play();
It will say that feet1 is undefined.
Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为是词根
I think is the root word
root
将转到当前 SWF 的最父级显示对象(如果该 SWF 加载到另一个 SWF 中,它仍然只会显示当前 SWF 的显示对象)。因此,一般规则是不要使用 root(尽管 root 并不像 AS2 中那样邪恶,而且偶尔也会有一些原因导致您可能会使用它)。
如果
guy
在舞台上,并且您的动作脚本也在舞台上,则以下内容应该有效:root
will goto the parent most display object of the current SWF (if the SWF is loaded in another SWF, it will still surface only to that of the current SWF).So as a general rule don't use root (although root isn't evil like in AS2, and there are occasional reasons why you might use it).
If
guy
is on the stage, and your actionscript is on the stage, the following should work: