as3-flash: any way to access all the instances placed in different frames from document class?

做~自己de王妃 提交于 2019-12-11 01:13:17

问题


I have programmed a game using the Flash authoring tool and a document class.
I'm trying to graphically add instances and add functionality in the document class.

Suppose I have a main timeline with 3 frames, each frame reperesents a different level of the game.
In frame 1 I have an instance of the MovieClip class named tree1 on the stage, and in frame 3 I have an instance of the MovieClip class named tree3 on the stage.

In my document class, after an initial stop() command, I want some logic like:

tree3.scaleX = tree1.scaleX;

But tree3 is unknown to the runtime since we are not of frame 3 yet.

Any way to access all the instances on all frames declared in the authoring tool from the document class? Thanks in advance.


回答1:


In a word, no. As you have said in your question, until the playhead reaches frame three the assets there do not exist.



来源:https://stackoverflow.com/questions/7022985/as3-flash-any-way-to-access-all-the-instances-placed-in-different-frames-from-d

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