views:

50

answers:

3

in my flex application:

<mx:Image  id="imgItem" source="http://notMySyte.com/1.jpg"/&gt;

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.

+2  A: 

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

<?xml version=“1.0″?>
    <cross-domain-policy>
        <allow-access-from domain=“*” />
    </cross-domain-policy>
    ...
colithium
I have this file. But nothing(
GLeBaTi
This answer is a bit unclear. When @colithium says "your root folder" he means the root folder of the domain serving the images, not the root folder of the domain serving the SWF.
www.Flextras.com
radical.ru - this is hosting of my images. http://www.radikal.ru/crossdomain.xml - crossdomain file of this hosting. He is valid. http://chfmm.ru/2 - my site. Click on the sit, and you see the preview of sits. Click at the some sit, and you see this error.
GLeBaTi
A: 

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

stephen
A: 

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