0

I am using as3httpclient library which uses Flash Socket for http communication. My swf is accessed from this address:

http://xxx.yyy.com/flash/UploadCharInfo.html

When I try to do a POST request to the server, after a few seconds I get exactly this Flash error:

Error #2048: Security sandbox violation: http://xxx.yyy.com/flash/UploadCharInfo.swf?1439403065 cannot load data from xxx.yyy.com:80.

I have put this cross-domain policy xml:

<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" to-ports="*"/>
    <allow-http-request-headers-from domain="*" headers="*"/>
    <allow-http-request-headers-from domain="*"/>
</cross-domain-policy>

at http://xxx.yyy.com/crossdomain.xml

In my code I have put at the top of the code:

    Security.allowDomain("*");
    Security.loadPolicyFile("http://xxx.yyy.com/crossdomain.xml");

I still get the dreaded #2048 error. What else is there to try?!

PS. My code works fine from within Flash Builder's debugging sandbox. The error appears when I try to play my swf online.

PS2. Just found another VERY similar answer here:Annoying Error #2048: Security sandbox violation from localhost

Community
  • 1
  • 1
Bill Kotsias
  • 3,258
  • 6
  • 33
  • 60
  • What does the POST request look like? – null Aug 13 '15 at 13:22
  • @null var client:HttpClient = new HttpClient(); var uri:URI = new URI("http://www.snee.com/xml/crud/posttest.cgi"); var variables:Array = [{name:"fname", value:"FirstName1"}, {name:"lname", value: "LastName1"}]; client.listener.onData = function(event:HttpDataEvent):void { // Notified with response content in event.bytes as it streams in }; client.listener.onComplete = function(event:HttpResponseEvent):void { // Notified when complete (after status and data) }; client.postFormData(uri, variables); – Bill Kotsias Aug 14 '15 at 07:10

0 Answers0