4 Replies Latest reply on Jan 14, 2011 10:05 AM by Flex harUI

    How and when to load cross-domain.xml for web services.

    Gregory Lafrance Level 6

      I'm accessing some 3rd party web services and so I need them to have a cross-domain.xml file, which they have done.

       

      In order to access their web services, am I correct that I need to load the cross-domain.xml file they put on their web server, and if so, is my code to do so below correct, which I put in my creationComplete handler function?

       

      Note, of course the IP address in my code is not 0.0.0.0.

       

      Do I need all these lines, and am I doing this correctly?

       

      Currently I am getting a SecurityErrorEvent.

       

      Security.allowDomain("0.0.0.0");
      Security.loadPolicyFile("http://0.0.0.0/crossdomain.xml");
      var request:URLRequest = new URLRequest("http://0.0.0.0/crossdomain.xml");
      var loader:URLLoader = new URLLoader();
      loader.addEventListener(Event.COMPLETE, policyLoaded);
      loader.addEventListener(IOErrorEvent.IO_ERROR, policyIOError);
      loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, policySecurityError);
      loader.load(request);