title: Crossdomain error / Error #2048 / Security error
body: <p>I have this script in AS3 that makes a screen capture and attempts to send it to a server. On localhost everything works fine but on deployment this error appears:</p>
  
  <pre><code>errorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]
  </code></pre>
  
  <p>The embed code is the following:</p>
  
  <pre><code>&lt;object data="record_preview.swf" type="application/x-shockwave-flash" id="flash_38533942" width="740" height="550"&gt;
  &lt;param name="allowscriptaccess" value="always"&gt;
  &lt;param name="allownetworking" value="all"&gt;
  &lt;param name="movie" value="record_preview.swf"&gt;
  &lt;param name="wmode" value="opaque"&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>crossdomain.xml is the following (both on destination script folder and domain root):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;
  
  &lt;cross-domain-policy&gt;
      &lt;site-control permitted-cross-domain-policies="all"/&gt;
  &lt;/cross-domain-policy&gt;
  </code></pre>
  
  <p>The AS3 script that manages the load is the following:</p>
  
  <pre><code>var header:URLRequestHeader = new URLRequestHeader("Content-type","application/octet-stream");
  var _swfurl:URLRequest = new URLRequest("http://domain/subfolder/script.php");
  _swfurl.requestHeaders.push(header);
  _swfurl.method = URLRequestMethod.POST;
  _swfurl.data = screenCapture.data;
  
  var _swfLoder:URLLoader = new URLLoader();
  _swfLoder.dataFormat = URLLoaderDataFormat.TEXT;
  _swfLoder.addEventListener( Event.COMPLETE, imageUrlLoaderComplete );
  _swfLoder.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
  _swfLoder.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
  _swfLoder.load( _swfurl );
  </code></pre>
  
  <p>The function <strong>imageUrlLoaderComplete</strong> loads the result from <strong>script.php</strong> in a textbox and <strong>errorHandler</strong> catches the errors given by the application.</p>
  
  <p>The swf file has been exported with <strong>access playback security: access network only</strong>.</p>
  
  <p>At this point I have simply no idea where exactly is the problem. Any suggestions will be welcome and tested!</p>
  
  <p>Thank you!</p>