Flex应用程序无法从其他服务器下载图像

发布于 2024-09-26 13:24:24 字数 908 浏览 1 评论 0原文

在我的 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 技术交流群。

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

发布评论

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

评论(3

北城半夏 2024-10-03 13:24:24

您需要通过在根文件夹中创建 crossdomain.xml 文件来明确允许跨域访问。

<?xml version="1.0" encoding="utf-8"?>
    <cross-domain-policy>
        <allow-access-from domain="*" />
    </cross-domain-policy>
    ...

You need to explicitly allow cross-domain access by creating a crossdomain.xml file in your root folder.

<?xml version="1.0" encoding="utf-8"?>
    <cross-domain-policy>
        <allow-access-from domain="*" />
    </cross-domain-policy>
    ...
潇烟暮雨 2024-10-03 13:24:24

您要从中加载图像的站点必须通过托管 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.

緦唸λ蓇 2024-10-03 13:24:24

您需要有一个 crossdomain.xml 文件。之后,您需要使用以下代码显式加载该跨域文件:

Security.loadPolicyFile("http://foo.com/crossdomain.xml");

You need to have a crossdomain.xml file. After that you need to explicitly load that crossdomain file using the code:

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