Flex SWF 资源在运行时加载到同一 ApplicationDomain 中的 Flash SWF 中

发布于 2024-08-12 23:10:01 字数 596 浏览 5 评论 0原文

我正在尝试将 Flex SDK 编译的 swf 加载到 Flash IDE 导出的 swf 中,并通过 getDefinition() 实例化资源。通常,这对于从 Flash IDE 导出然后加载到同样从 Flash IDE 加载到另一个 swf 的资源来说效果很好。

这就是我通常仅使用 Flash IDE 执行此操作的方法:
装载机->使用相同的ApplicationDomain - > getDefinition(class)

现在,使用使用 [Embed] 元数据标记从 Flex SDK 编译的“Test.as”:
装载机->使用相同的ApplicationDomain - > getDefinition("Test_" + class)

问题是我不想跟踪加载的资源库以作为我想要获取的类名的前缀 ((' Test_" + class) vs (class))。是否有任何方法可以在不引用从中提取类的库或不访问原始加载器的情况下执行此操作?这样我不需要知道哪个资产来自 .swf,只是我可以从当前 ApplicaitonDomain 实例化的类名称,

谢谢。

I'm trying to load a swf compiled by the Flex SDK into a swf exported by the Flash IDE and instantiate the assets by way of getDefinition(). Normally this works fine with assets exported from the Flash IDE then loaded into another swf also from Flash IDE.

This is how I could normally do this using only the Flash IDE:
Loader - > Using same ApplicationDomain - > getDefinition(class)

Now, using the 'Test.as' compiled from Flex SDK using the [Embed] metadata tag:
Loader - > Using same ApplicationDomain - > getDefinition("Test_" + class)

The problem is I'd rather not have to keep track of the asset libraries loaded to prefix the class name I'd like to get (('Test_" + class) vs (class)). Is there any way of doing this without referencing the library the class is being pulled from or without accessing the original loader? This way I don't need to know which swf the asset is coming from, just the class name that I could instantiate from the current ApplicaitonDomain.

Thanks

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

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

发布评论

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

评论(1

‘画卷フ 2024-08-19 23:10:01

您是否尝试过仅加载 swf,并在其完全加载后调用 getDefinition(class)?
无嵌入

Did you try just loading the swf and when it's completely loaded, getDefinition(class)?
No Embeds

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