闪存-AS3 code的执行顺序:gotoAndStop后访问闪存亲实例() [英] flash-as3 code execution order: accessing a flash pro instance after gotoAndStop()
问题描述
这是一个后续问题<一href="http://stackoverflow.com/questions/7022985/as3-flash-any-way-to-access-all-the-instances-placed-in-different-frames-from-do">this问题 的
我从来没有真正得到了闪光的ActionScript code的执行顺序。
i have never actually got the flash-actionscript code execution order.
闪光灯亲我有一个moveiclip的实例在帧中的一个名为阶段树1
和框架3我在舞台上的 tree3
。
in flash pro i have an instance of a moveiclip on stage in frame one named tree1
and on frame 3 i have on the stage tree3
.
在文档类我有这个code:
in the document class i have this code:
stop();
var scaleFactor:Number = tree1.scaleX;
gotoAndStop(3);
tree3.scaleX = scaleFactor;
虽然这在桌面上测试时的作品,这个程序将进入移动在年底
while this works when testing on the desktop, this app will go mobile at the end
这是走在正确的道路或者我应该注册一个frameComplete事件在访问某一帧实例之前
is this the correct way to go or should i register for a frameComplete event before accessing instances on a certain frame
推荐答案
等待Event.FRAME_CONSTRUCTED是正确的做法,只要在时间轴上访问资产
waiting for Event.FRAME_CONSTRUCTED is the correct way whenever accessing assets on a timeline
这确保了所有资产已创建
it insures all assets have been created
这篇关于闪存-AS3 code的执行顺序:gotoAndStop后访问闪存亲实例()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!