获取另一帧中的MovieClip
我在电影的第一帧中,我想使用 getChildByName("mc_movieclip");获取对 mc_movieclip 的引用。问题是 mc_movieclip 不存在于第 1 帧中,而只存在于第 5 帧中。即使它位于另一个帧中,我怎样才能获得对此 MovieClip 的引用?
I'm in frame 1 of a movie, and I want to use getChildByName("mc_movieclip"); to get a reference to mc_movieclip. The problem is that mc_movieclip does not exist in frame 1 but only in frame 5. How can I get a reference to this MovieClip, even though it's in another frame?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决此问题的最简单方法是将
mc_movieclip
的副本放在第 1 帧上并将其隐藏。mc_movieclip.visible=false
就可以了。注意:如果您的 mc 有动画(在其时间轴中),那么您必须在第 5 帧上重新启动该动画才能获得与之前相同的效果。
The easiest way to fix this is that you put a copy of
mc_movieclip
on frame 1 and make it hidden.mc_movieclip.visible=false
will do the trick.Note: if your mc has animation (in its timeline) then you have to restart that animation on frame 5 to get the same effect as before.