闪光AS3 - 如何访问其他框架中显示对象(即一帧以上的除外) [英] Flash AS3 - How do I access display object in other frames (aka a frame other than one)

查看:110
本文介绍了闪光AS3 - 如何访问其他框架中显示对象(即一帧以上的除外)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

getChildByName(名称)将作为长期工作,因为这孩子是在第一帧。

getChildByName('name') will work as long as that child is in the first frame.

推荐答案

在其它帧显示对象没有被实例化还没有,所以它不是这么多,你不能访问他们。它们不存在于被访问。在播放头通入具有一定对象的关键帧,则该对象被创建并添加到舞台,并当播放头通入一个新的关键帧不具有该对象,该对象将被破坏。因此,访问该对象的唯一方法就是 gotoAndStop()来一个框架对象所在的时间轴上。

Display objects in other frames haven't been instantiated yet, so it's not so much that you can't access them; they aren't there to be accessed. When the playhead passes into a keyframe with a certain object, that object is created and added to the stage, and when the playhead passes into a new keyframe that doesn't have that object, the object is destroyed. So the only way to access the object is to gotoAndStop() to a frame where the object exists on the timeline.

如果这会导致问题 - 也就是说,如果你有只出现在舞台上,在框架5的对象,你需要访问它的第1帧,试着改变你的时间表,使该对象存在于第1帧,但台下或以其他方式隐藏起来。只要它存在,就可以正常访问,而且你可以将它搬上舞台帧5或其它地方。

If this causes problems - that is, if you have an object that only appears on the stage at frame 5, and you need to access it in frame 1, try changing your timeline so that the object exists on frame 1 but is offstage or otherwise hidden from view. As long as it exists, you can access it normally, and you can just move it onto the stage in frame 5 or wherever.

这篇关于闪光AS3 - 如何访问其他框架中显示对象(即一帧以上的除外)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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