Flex应用程序无法从其他服务器下载图像
在我的 Flex 应用程序中:
<mx:Image id="imgItem" source="http://notMySyte.com/1.jpg"/>
当我运行我的应用程序时,我收到此错误:
SecurityError: Error #2123: Security sandbox violation: Loader.content: http://mySite.com/2/BusFlex/BusProducts.swf/[[DYNAMIC]]/2 cannot access http://cs9621.notMySite.com/u7397474/c_b51d9fe6.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::Loader/get content()
at mx.controls::SWFLoader/get content()
at mx.controls::SWFLoader/doSmoothBitmapContent()
at mx.controls::SWFLoader/updateDisplayList()
at mx.controls::Image/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
请帮助我。
in my flex application:
<mx:Image id="imgItem" source="http://notMySyte.com/1.jpg"/>
when i run my app, I catch this error:
SecurityError: Error #2123: Security sandbox violation: Loader.content: http://mySite.com/2/BusFlex/BusProducts.swf/[[DYNAMIC]]/2 cannot access http://cs9621.notMySite.com/u7397474/c_b51d9fe6.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::Loader/get content()
at mx.controls::SWFLoader/get content()
at mx.controls::SWFLoader/doSmoothBitmapContent()
at mx.controls::SWFLoader/updateDisplayList()
at mx.controls::Image/updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
help me please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要通过在根文件夹中创建 crossdomain.xml 文件来明确允许跨域访问。
You need to explicitly allow cross-domain access by creating a crossdomain.xml file in your root folder.
您要从中加载图像的站点必须通过托管 cross-domain.xml 文件来显式授予 Flash/Flex 应用程序权限。
The site you are loading images from has to explicitly grant Flash/Flex applications by hosting a cross-domain.xml file.
您需要有一个 crossdomain.xml 文件。之后,您需要使用以下代码显式加载该跨域文件:
You need to have a crossdomain.xml file. After that you need to explicitly load that crossdomain file using the code: