I have this:
import JPGEncoder;
var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0);
var bm:Bitmap = new Bitmap(bmd);
bm.alpha = .5;
stage.addEventListener(MouseEvent.MOUSE_DOWN, screenCap);
function screenCap(e:Event):void {
bmd.draw(this);
var jpgVersion:JPGEncoder = new JPGEncoder( 80 );
var jpgStream:ByteArray = jpgVersion.encode( bmd );
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("http://localhost/takeshot.php");
request.method = URLRequestMethod.POST;
request.data = jpgStream;
loader.load(request);
function dataOnLoad(e:Event){
trace("Complete..");
}
}
Which takes a screenshot of the stage and is supposed to send the Byte array of the screenshot to PHP through POST data, My PHP just opens a new file, writes post data and closes (for testing purpose). But the $_POST is empty!