SWF 不是可加载模块

发布于 2024-07-17 06:17:57 字数 566 浏览 11 评论 0原文

我们正在创建一个应用程序,该应用程序使用动态加载到主 swf 中的模块。 我们遇到的问题是,当我们在本地调试主应用程序时,我们无法加载位于测试服务器上的模块。 我们得到的错误是“SWF 不是可加载模块”。

我查了一下,发现我们需要在服务器上有一个跨域文件,该文件授予从外部位置加载模块的权限。 因此我们创建了一个简单的跨域文件并将其放在服务器上,但这似乎没有帮助。

这是跨域文件:

<cross-domain-policy>
  <allow-access-from domain="*"/>
</cross-domain-policy>

我们通过 ModuleLoader 类和所有默认设置加载模块,没有自定义应用程序域等。当我们将主 swf 部署到服务器上时,我们能够毫无问题地加载模块。

有什么线索吗? 跨域文件是否可能缺少某些设置?

更新:外部模块似乎已成功加载(我可以在 HTTP 嗅探器中验证),但在主应用程序中加载时无法初始化。 错误仍然是“SWF 不是可加载模块”

We are creating an app that uses modules which are dynamically loaded into the main swf. The problem we run into, is that we are unable to load the modules located on a test server when we are debugging the main app locally. The error we get is "SWF is not a loadable module".

I looked this up and found out that we need a crossdomain file on the server that grants permission to load the modules from external locations. So we created a simple crossdomain file and put that on the server, but this does not seem to help.

Here's the crossdomain file:

<cross-domain-policy>
  <allow-access-from domain="*"/>
</cross-domain-policy>

We are loading the module via the ModuleLoader class and all default settings, no custom app domain etc. When we deploy the main swf onto the server we are able to load the modules without problems.

Any clues? Is the crossdomain file perhaps missing some settings?

Update: It seems that the external module is loaded successfully (I can verify in my HTTP sniffer) but fails to initialize when loaded in the main app. The error still is "SWF is not a loadable module)

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

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

发布评论

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

评论(5

暖心男生 2024-07-24 06:17:57

以下是 Adob​​e JIRA 提出的建议:http://bugs.adobe.com/jira /浏览/SDK-15393

Here is a proposed soultion from Adobe JIRA: http://bugs.adobe.com/jira/browse/SDK-15393

北凤男飞 2024-07-24 06:17:57

我认为 Adob​​e 尝试访问端口 843 上的跨域文件,如果它无法连接/找到该端口上的文件,它会尝试您尝试连接的端口(如果是 http,则可能是 80)。 不确定,但您可能需要检查以确保您的服务器允许访问该文件。

另外值得一提的是,您应该允许完全访问本地 swf 应用程序所在的目录。 使用 Adob​​e 设置管理器执行此操作:
http://www.macromedia.com/support/documentation/ en/flashplayer/help/settings_manager04.html

顺便说一句,我认为设置管理器是 Flash 生态系统中最糟糕的 UI 灾难之一。 事实上,他们需要在经理下方的文本中澄清,这实际上不是屏幕截图,这一事实确实很重要。

I think Adobe tries to access the cross domain file on port 843 and if it cannot connect/find the file on that port it tries the port that you're trying to connect to (probably 80 if it's http). Not sure but you might want to check to make sure that your server allows access to the file.

Also worth mentioning is that you should allow full access to the directory where your local swf application resides. Do this with the Adobe settings manager:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

As a side note, I think the settings manager is one of the worst UI atrocoties in the flash eco system. Just the fact that they need to clarify in a text underneith the manager that it is infact NOT a screenshot really takes the cake.

嘿咻 2024-07-24 06:17:57

我同意这可能是本地 SWF 和远程 SWF 之间的问题。 尝试将本地文件上传到服务器(您有权访问的任何服务器),或者,如果您正在运行本地 Apache 或 IIS,请尝试使用 http://localhost/。 如果有效,我们就会知道问题出在本地文件和远程文件之间。 如果没有,则问题出在 crossdomain.xml 或代码中,这种可能性较小,但我们还不应该排除它。 如果您确定问题出在使用本地 SWF 上,请在“设置管理器”中添加本地文件夹(请参阅 macke 的帖子)

I agree that it could be an issue between local SWFs and remote SWFs. Try uploading your local file to a server (any server you have access to) or, if you've got a local Apache or IIS running, try accessing that SWF using http://localhost/. If that works, we'll know that the issue is in going between a local file and a remote file. If it doesn't than the issue is either with crossdomain.xml or in your code, which is less likely but we shouldn't rule it out just yet. If you do determine that the issue is with using a local SWF, then add the local folder in the Settings Manager (see macke's post)

攒一口袋星星 2024-07-24 06:17:57

这是根据 Adob​​e 的建议捆绑在一起可供使用的解决方案。

http://aaronhardy.com/flex/loading -a-remote-module-into-a-local-app/

Here's a solution bundled up ready for use based on Adobe's recommendation.

http://aaronhardy.com/flex/loading-a-remote-module-into-a-local-app/

请止步禁区 2024-07-24 06:17:57

看起来与我的跨域类似

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>

,位于您的本地服务器根目录上,对吗?

你检查过你的目录权限吗?

Looks similar to my cross domain

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>

That is on your local server root, correct?

Have you checked your directory permissions?

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