如何在 Flash 的带宽分析器中找到大小的来源?
我正在开发 Flash CS5/AS3 预加载器,带宽分析器告诉我,我的第 1 帧大小很大 - 大约 850kb。帧 2 为 128kb。这会导致在大部分加载过程中出现白屏,然后是简短且现在不必要的预加载器,然后是 swf 的其余部分。
我设置了两个框架,第一个是带有以下代码的预加载器:
stop();
addEventListener(Event.ENTER_FRAME, preLoad)
function preLoad(event:Event):void{
var bytestoLoad:Number = loaderInfo.bytesTotal;
var numberLoaded:Number = loaderInfo.bytesLoaded;
if (bytestoLoad == numberLoaded){
removeEventListener(Event.ENTER_FRAME, preLoad)
gotoAndStop(2);
} else {
preLoaderInst.preLoaderFill.scaleX = numberLoaded/bytestoLoad;
preLoaderInst.bytesPercent.text = Math.floor(numberLoaded/bytestoLoad*100) + "%";
}
}
框架 2 只有: stop();
与 fla 关联的 .as 文件包含大量其他信息,是一个完整的游戏。请告诉我这里的更多详细信息是否有帮助。
我已经浏览了我的库并使用 Linkage 对所有符号进行了检查,未选中“在第 1 帧中导出”。而且预加载器很小,只有一个文本框和一个形状。
如何获取第 1 帧中加载的更多详细信息,以便将其移动到第 2 帧?非常感谢您抽出时间!
I'm working on a Flash CS5/AS3 pre loader, and the bandwidth profiler is telling me that my frame 1 size is massive - about 850kb. Frame 2 is 128kb. This results in a white screen during the bulk of loading, followed by the brief and now-unecessary preloader, and then the rest of the swf.
I have a setup of two frames, the first being the preloader with the following code:
stop();
addEventListener(Event.ENTER_FRAME, preLoad)
function preLoad(event:Event):void{
var bytestoLoad:Number = loaderInfo.bytesTotal;
var numberLoaded:Number = loaderInfo.bytesLoaded;
if (bytestoLoad == numberLoaded){
removeEventListener(Event.ENTER_FRAME, preLoad)
gotoAndStop(2);
} else {
preLoaderInst.preLoaderFill.scaleX = numberLoaded/bytestoLoad;
preLoaderInst.bytesPercent.text = Math.floor(numberLoaded/bytestoLoad*100) + "%";
}
}
Frame 2 just has:stop();
The .as file associated with the fla has tons of other information, a full game. Let me know if more detail here is helpful.
I've already gone through my library and on all the symbols with Linkage, unchecked the "Export in Frame 1". Also the pre-loader is small, only a text box and a shape.
How can I get more detail of it's loading in frame 1 so that I can move it to frame 2? Thanks so much for your time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该将第一帧留空,只需在其中添加预加载项即可。
在库中,检查为动作脚本导出的所有符号。您必须取消选中“在第一帧中导出”复选框。
此时,您的符号根本不会导出到 swf 中,除非您将它们放在舞台上的某个位置。
我的建议是将每个符号的一个实例放在第 2 帧上,并通过直接跳转到加载程序中的第 3 帧来跳过这一帧:gotoAndStop(3);
正如建议的,您应该考虑使用另一个 swf 来加载主 swf。
You should leave the first frame empty, just add the preloader item in it.
In the library, check all the symbols that are exported for actionscript. You must uncheck the "export in first frame" checkbox.
At this point your symbols are not exported at all in the swf except if you put them somewhere on the stage.
My advice is to put one instance of each symbol on frame 2 and skip this frame by jumping directly to frame 3 in your loader : gotoAndStop(3);
As adviced, you should consider using another swf for loading the main swf.
我不知道你的 fla 文件,但如果你的库中有为 AS 导出的对象。它们有一个属性“在第 1 帧中导出”。这将使所有对象在第一帧加载。
希望它有帮助,我更喜欢制作另一个将 main 加载到其中的 swf 文件。这将解决您的问题。取消选中“在第 1 帧中导出”不会对您有太大帮助。
你的方式听起来像 activeden 预加载器,这不是最好的方式。
I've no clue about your fla file, but if there is objects that exported for AS in your library. They have a property "Export in frame 1". This will make all of your objects to load at first frame.
Hope it helps, i prefer to make another swf file that loads main into it. This will solve your problems. Unchecking "Export in frame 1" will not help you much.
your way sounds like activeden preloaders that not the best way.