1

在我的弹性应用程序中:

<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()

请帮帮我。

4

3 回答 3

2

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

<?xml version="1.0" encoding="utf-8"?>
    <cross-domain-policy>
        <allow-access-from domain="*" />
    </cross-domain-policy>
    ...
于 2010-10-03T15:55:49.533 回答
1

您从中加载图像的站点必须通过托管 cross-domain.xml 文件来明确授予 Flash/Flex 应用程序。

于 2010-10-03T16:59:19.367 回答
1

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

Security.loadPolicyFile("http://foo.com/crossdomain.xml");
于 2010-10-04T04:17:54.997 回答