Glebka
Glebka

Reputation: 1678

Flex app cannot download images from other servers

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.

Upvotes: 1

Views: 1110

Answers (3)

colithium
colithium

Reputation: 10327

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>
    ...

Upvotes: 2

user235273
user235273

Reputation:

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");

Upvotes: 1

stephen
stephen

Reputation: 116

The site you are loading images from has to explicitly grant Flash/Flex applications by hosting a cross-domain.xml file.

Upvotes: 1

Related Questions