Flash AS3:错误#1014:远程加载但不是本地加载

时间:2012-04-02 20:06:16

标签: actionscript-3 flash

从一个空白项目开始,当我加载一个依赖于在swc中定义的ISomeInterface的SWF时,它被编译到我的空白项目中

var lc:LoaderContext = new LoaderContext( true, ApplicationDomain.currentDomain );
var loader:Loader = new Loader();                       
loader.load( new URLRequest( "Some.swf"), lc );

并不是太令人惊讶的一切都很好,因为它所需的接口已经在它所加载的应用程序域中。

但是,当我从远程URL加载相同的文件时

loader.load( new URLRequest( "http://127.0.0.1/Some.swf"), lc );

我得到了邪恶的

[Fault] exception, information=VerifyError: Error #1014: Class ISomeInterface could 
not be found

我错过了什么让这些与众不同?

2 个答案:

答案 0 :(得分:1)

我的问题似乎是2倍

1)在本地加载资产时,默认情况下会将其加载到正确的安全域中。但是,从网站加载时,我需要确保正确设置安全域

new LoaderContext( true, ApplicationDomain.currentDomain, SecurityDomain.currentDomain )

2)但是,当你正在进行加载的swf实际上是自己远程加载时,你只能使用SecurityDomain:

Security.sandboxType == Security.REMOTE

所以没有本地和远程的混合模式。 最后,只需从网站加载第一个SWF,然后添加正确的SecurityDomain即可。

在我的搜索中,这是我在安全域和应用域名http://www.senocular.com/flash/tutorials/contentdomains/

主题中发现的最佳观点

答案 1 :(得分:0)

由于您在本地进行测试,您可能需要检查一下:

http://jansensan.net/flash-player-security-settings-to-develop-locally

基本上转到Flash Player安全页面:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

点击修改位置 - >添加位置

添加项目文件夹或文件系统根目录。