1
votes

I want to access a script on another domain(I have access to this other domain too). I added a very permissive crossdomain.xml file on the root of the domain

<?xml version="1.0" ?>
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only"/>
  <allow-access-from domain="*"/>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

crossdomain.xml link

This is my AS3 code

var domainsCSV:String=domains.join(",");
var url:String="https://page1traffic.net/keywordxpapi/testscript.php";
var urlRequest:URLRequest=new URLRequest(url);
urlRequest.method=URLRequestMethod.POST;
var variables : URLVariables = new URLVariables();
variables.domains=domainsCSV;
urlRequest.data=variables;
var urlLoader:URLLoader=new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, onComplete);
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR,onError);
urlLoader.load(urlRequest);
function onComplete(e:Event):void{
}

function onError(e:Event=null):void{
    trace(e);
    if(e is SecurityErrorEvent){
        trace(SecurityErrorEvent(e).text);
    }
    Alert.show("Error from script "+e);

}

I get the SecurityErrorEvent 2048 , I checked in firebug and I see the browser reciving the xml response so I have no idea why I can't make cross domains calls.

1
senocular.com/pub/adobe/crossdomain/… in case your swf file is from insecure protocol (http) you need to add secure="false" to the allow-access-from nodefsbmain
Are you trying to load it from Amazon S3 server?Aditya

1 Answers

2
votes

Try <allow-access-from domain="*" secure="false"/>