1

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.

Glebka
  • 1,420
  • 3
  • 20
  • 37

3 Answers3

2

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>
    ...
ocodo
  • 29,401
  • 18
  • 105
  • 117
colithium
  • 10,269
  • 5
  • 42
  • 57
  • I have this file. But nothing( – Glebka Oct 03 '10 at 16:03
  • 1
    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. – JeffryHouser Oct 03 '10 at 17:18
  • 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. – Glebka Oct 16 '10 at 10:22
  • @GLeBaTi - Why is this answer marked as correct when you're commenting that it's still broken here, can you confirm you solved the problem? – ocodo Sep 22 '11 at 01:41
1

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

stephen
  • 116
  • 1
1

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