3 Replies Latest reply on Mar 5, 2012 10:03 AM by Flex harUI

    URLLoader cant load binary data from different domain


      Two important points. 1 - SWF must have ability to loading binary data from any domain. 2 - SWF cant load policy XML file from url, cause upload form allows me only to upload swf files, so I cant include any other data. I tried:


      But it works only for SWF files. I tried to embed policy XML file:

           var dataXML:XML =

           <?xml version="1.0"?>

           <!-- http://www.foo.com/crossdomain.xml -->


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



      But Security.loadPolicyFile(url:String) allows only to set file url, not data. So my question is, how can I allow SWF to load binary files from different domains without having any additional file? URLLoader code:


           var request:URLRequest = new URLRequest("http://differentdomain.com/binaryfile.dat");

           var words:URLLoader = new URLLoader();

           words.dataFormat = URLLoaderDataFormat.BINARY;

           words.addEventListener(Event.COMPLETE, prepareFile);

           words.addEventListener(IOErrorEvent.IO_ERROR, loadError);

           words.addEventListener(SecurityErrorEvent.SECURITY_ERROR, secureError);



      This will make an security error, if file is from different domain than SWF file. Thanks for any help.