8 Replies Latest reply: Feb 28, 2012 1:51 AM by JonoB RSS

    Adobe Flex unable to load images from Amazon S3

    JonoB

      I have a flex 3 app that is attempting to load images from Amazon S3. The images fail to load, so I fired up debug mode. In debug mode, the images load, but I also get the following output in the debugger:

       

       

          *** Security Sandbox Violation ***

          SecurityDomain 'http://mybucket.s3.amazonaws.com/logos/mylogo.png' tried to access incompatible context 'http://localhost/myapp/bin-debug/index.html?debug=true'

       

       

      I have added a crossdomain.xml file into the root of my bucket as follows, but this does not seem to help:

       

       

          <?xml version="1.0" encoding="utf-8" ?>

          <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

          <cross-domain-policy>

            <site-control permitted-cross-domain-policies="master-only" />

            <allow-access-from domain="*" />

            <allow-http-request-headers-from domain="*" />

          </cross-domain-policy>

       

      I then tried the following:

       

      Security.loadPolicyFile('http://mybucket.s3.amazonaws.com/crossdomain.xml');

      Security.allowInsecureDomain('http://mybucket.s3.amazonaws.com/');

      Security.allowDomain('http://mybucket.s3.amazonaws.com/');

       

      At this point, it seems that there are not any more errors reported in debug mode. However, when not in debug mode, then the image still does not load.

       

      Am I missing something obvious here?