Reputation: 1394
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.
Upvotes: 1
Views: 1764