-use-network


工程刚刚加载就发现报错信息:Main.swf 不能访问本地资源 data/data3.xml。只有仅限于文件系统的 SWF 文件和可信的本地 SWF 文件可以访问本地资源。" faultCode="InvokeFailed" faultDetail="null"]


google一下: 在工程属性 Additional compiler arguments 加入 -use-network=false   


关于use-network=true|false的解释

Specifies that the current application uses network services.
The default value is true.
When the use-network property is set to false, the application can access the local filesystem (for example, use the XML.load() method with file: URLs) but not network services. In most circumstances, the value of this property should be true.

For more information about the use-network property, see Applying Flex Security.

 

另外网上一篇博客说:

将flex项目中的bin-debug文件夹移动到其它地方运行swf的时候无法加载本地文件,提示仅限于文件系统的 SWF 文件和仅限于网络的 SWF 文件不能彼此加载?的解决办法

在project-properties-flex compiler-添加命令参数:-use-network=false
就可以正常加载了。
然后将编译好的swf文件拷贝到其他目录也能直接用Flash Player正常打开,但是不能在网络上访问。

你可能感兴趣的:(xml,Security,Google,Flex,Flash)