AS2 站点的简单预加载器问题
我被要求向一个构建相当混乱的 AS2 网站添加一个预加载器。我使用的是在第一帧中预加载的方法——整个站点中有大量对 _root 的引用,因此我无法将主站点作为另一个 swf 在外部加载。我的方法只是在时间线的开头创建一个新帧,将所有现有内容移至正确的一帧,然后将网络上可用的数百万个一次性预加载器中的一个添加到第一帧。
我遇到的问题是,无论出于何种原因,99% 的网站权重都在第一帧中导出(如“生成大小报告...”所报告),尽管 a) 舞台上没有任何内容但是第 1 帧和 b) 中的预加载器我在第 2 帧上导出了我的动作脚本类。具有链接的库项目非常少,所有链接的项目都设置为在第 2 帧中导出。显然,预加载器不是按预期工作,因为直到所有内容都已加载后它才会显示。
我在这里缺少什么?
谢谢!
I was asked to add a preloader to a rather messily constructed AS2 website. I'm using the preloader-in-the-first-frame approach--there are tons of references to _root throughout the site so I can't load the main site externally as another swf. My approach just involved creating a new frame at the beginning of the timeline, bumping all the existing content to the right one frame, and adding to the first frame one of the millions of throwaway preloaders available on the web.
The problem I'm having is that for whatever reason, 99% of the site weight is being exported in the first frame (as reported by "Generate Size Report..."), despite the fact that a) there's nothing on the stage but the preloader in frame 1 and b) I've got my actionscript classes exporting on frame 2. There are very few library items with linkage, and all that are linked are set to export in frame 2. Obviously, the preloader isn't working as desired, because it doesn't show up until everything's already been loaded.
What am I missing here?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是因为您的所有艺术资源都在第一帧中加载。
解决此问题的正常方法是将主站点的开头移至第三帧,将所有库内容的一个副本转储到第二帧上,然后取消选中库中所有内容的“在第一帧中导出”。
也就是说,我不知道为什么您认为不能将其作为外部 .swf 加载 - 在子 swf 中,
_root
映射到子级的根,而不是容器中的任何内容。This is because all your art assets are being loaded in the first frame.
The normal way of solving this is to shift the start of the main site to frame three, dump one copy of all of your library stuff on frame 2, and uncheck "Export in first frame" for everything in the library.
That said, I don't know why you think you can't load it as an external .swf - in a child swf,
_root
maps to the root of the child, rather than anything in the container.我要做的就是在站点后面的时间轴上添加一个关键帧并将整个库拖到那里,这将导致所有内容在预加载器之后预加载。确保在所有元素上取消单击“导出到第一帧”。
另一个注意事项:
您的网站是 Flash 的,不会被搜索引擎索引。一些 as2 可以被 penguin/panda 读取,但大多数不能。对于 SEO 来说,Flash 网站会损失很多。
What i would do is add a keyframe on the timeline after the site and drag the entire library there, this would cause everything to preload after the preloader. Make sure you unclick export to first frame on all elements.
Another note:
Your website, being flash, will not be indexed by search engines. Some as2 is read by penguin/panda but most is not. A lot is lost with a flash website that is SEO.