将 AS2 swf 加载到 AS3 swf 时出现问题
我一直在努力让 AS2 swf 在 AS3 swf 中正确加载 - 但无济于事...
AS2 文件(这是一个引用许多外部 xml 文件等的相当大的应用程序)在启动时完美运行闪存播放器。
当尝试通过 AS3 swf(使用 URLRequest 和 Loader 类)加载同一文件时,文件开始加载,但在预加载阶段突然停止。 (如果我尝试使用 AS2“loadMovie”加载它,也会发生同样的情况。)
更新:看起来 swf 实际上是通过 AS2 loadMovie 而不是 AS3 Loader 类加载的。
还有什么可以尝试的?安全设置、自定义加载器类 - 如有任何建议,我们将不胜感激。
I've been trying very hard to get an AS2 swf to load properly inside an AS3 swf - but to no avail ...
The AS2 file (which is a rather big app referencing many external xml files etc.) works perfectly when launched in Flash Player.
When trying to load the same file through an AS3 swf (using URLRequest and Loader classes), the file starts loading but stops abruptly during the preloading phase. (Same happens if I try to load it using AS2 "loadMovie".)
Update: It seems as if the swf actually loads through AS2 loadMovie but not AS3 Loader class.
What is there more to try? Security settings, custom loader classes - any advice is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另请记住,加载到 AS3 swf 中的 AS2 swf 在与其父 swf 通信时会出现问题,因此加载器将无法跟踪 swf 的加载 - 因此这可能会给您带来问题。您应该构建在 AS2 中加载的 swf,然后使用 LocalConnection 将其连接到 AS3 swf。
Also keep in mind that an AS2 swf loaded into an AS3 swf will have problems communicating to it's parent swf, so the Loader will have trouble keeping track of the loading of the swf - so that might cause you a problem. You should build the swf that DOES the loading in AS2 and then connect it to an AS3 swf using LocalConnection.
一般来说,您加载的电影必须设计为从其他 swf 加载。例如,任何初始化代码都必须放置在 Event.ADDED_TO_STAGE 事件发生之后,并且对根的每个引用都不会按您的预期工作。例如,元素的根是 swf 单独运行时的阶段,但是当 swf 从另一个 swf 加载时,根是父 swf,其大小和位置可能不同,会给您带来一些麻烦。
In general your loaded movie have to be designed to be loaded from an other swf. For example any initialization code must be places after the Event.ADDED_TO_STAGE event occurs and every references to the root don't work as you expect. For example the root for an element it's the stage when the swf runs alone but when the swf it's loaded from another swf the root it's the parent swf that can be different in size and position causing you some trouble.
在您的 AS2 代码中,请务必将 lockroot (或者是 _lockroot?) 设置为 true。另外,如果您在 AS2 代码中的任何地方使用 _level0,它将不起作用,您需要将其更改为 _root。
In your AS2 code, be sure to set lockroot (or was it _lockroot?) to true. Also if you use _level0 in your AS2 code anywhere, it will not work, you need to change that to _root.
检查这个。
或
将所有 AS2 APP 类导出到框架 2(在发布设置中)。
check this one.
or
export all your AS2 APP classes to frame 2 (in publish setting).