2

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:

errorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]

The embed code is the following:

<object data="record_preview.swf" type="application/x-shockwave-flash" id="flash_38533942" width="740" height="550">
<param name="allowscriptaccess" value="always">
<param name="allownetworking" value="all">
<param name="movie" value="record_preview.swf">
<param name="wmode" value="opaque">
</object>

crossdomain.xml is the following (both on destination script folder and domain root):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
</cross-domain-policy>

The AS3 script that manages the load is the following:

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 );

The function imageUrlLoaderComplete loads the result from script.php in a textbox and errorHandler catches the errors given by the application.

The swf file has been exported with access playback security: access network only.

At this point I have simply no idea where exactly is the problem. Any suggestions will be welcome and tested!

Thank you!

Sunil D.
  • 17,983
  • 6
  • 53
  • 65
Mike
  • 3,017
  • 1
  • 34
  • 47
  • 2
    Check out this answer http://stackoverflow.com/questions/5157089/flex-security-sandbox-violation-error2048 – francis Apr 12 '12 at 21:18

0 Answers0