加载的 SWF 中的类不能在加载 SWF 时使用基类

发布于 2024-09-19 21:06:27 字数 730 浏览 3 评论 0原文

我有两个 SWF 文件,我将其称为“容器”和“从属文件”。 slave 文件包含一个影片剪辑,该影片剪辑是从我称为 base 的类扩展而来的。 base 扩展了 MovieClip 并编译成 SWC。 slave 将此 SWC 作为运行时库包含在内,而 container 将其作为合并包含(并且确实引用了它,因此应将其编译到 container SWF 中) )。

container 像这样加载 slave

bgURLRequest = new URLRequest(slaveUrl);
var context:LoaderContext = new LoaderContext(false, new ApplicationDomain( null ), SecurityDomain.currentDomain);          
bgLoader.load(bgURLRequest, context);

当加载发生时,我收到类 base 未找到的错误。我怀疑这与其中存在 ApplicationDomain 有关。我不确定它到底是做什么的,因为我自己没有编写这个加载代码(但我确实知道它的存在是有原因的,所以不能简单地删除它)。

如何修复?

I have two SWF files which I shall call container and slave. The slave file contains a movieclip that extends from a class I shall call base. base extends MovieClip and is compiled into an SWC. slave includes this SWC as a runtime library, while container includes it as merged (and does reference it so it should be compiled into the container SWF).

The container loads the slave like so:

bgURLRequest = new URLRequest(slaveUrl);
var context:LoaderContext = new LoaderContext(false, new ApplicationDomain( null ), SecurityDomain.currentDomain);          
bgLoader.load(bgURLRequest, context);

When this loading happens, I get the error that class base was not found. I suspect this has something to do with the presence of the ApplicationDomain in there. I'm not sure what it does exactly, since I didn't write this loading code myself (but I do know that it's there for a reason so it can't be simply removed).

How to fix?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

相守太难 2024-09-26 21:06:27

这就是解决方案

new LoaderContext(false, new ApplicationDomain( ApplicationDomain.currentDomain ), SecurityDomain.currentDomain); 

This is the solution

new LoaderContext(false, new ApplicationDomain( ApplicationDomain.currentDomain ), SecurityDomain.currentDomain); 
青巷忧颜 2024-09-26 21:06:27

使用 ApplicationDomain.currentDomain 并通过位于以下位置的超级 getDefinitionNames 跟踪可用类: http://etcs.ru/pre /getDefinitionNamesSource/

至少您会知道加载的 swf 中有哪些可用内容。

Use ApplicationDomain.currentDomain and track the available classes with the super getDefinitionNames available at: http://etcs.ru/pre/getDefinitionNamesSource/

At least you'll know whats available in the loaded swf.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文