try using this method :
code to capture pictures from flash and send them to php :
(some dumb here like zip creation)
// save picture :
public function saveOutCanva(maxdpi:uint = 300, savebg:String="1"):uint
{ var dpi:Number = 72;
var ratio:Number = maxdpi/72;
var snap:ImageSnapshot;
var pngenc:PNGEncoder = new PNGEncoder();
// compute snapshoot size
if(canvas.width > canvas.height)
{ if(canvas.width*ratio > 2800) ratio = 2800/canvas.width;
} else
{ if(canvas.height*ratio > 2800) ratio = 2800/canvas.height;
}
var realdpi:uint = uint(ratio*72);
...
// resize
canvas.scaleX = ratio;
canvas.scaleY = ratio;
...
// launch snapshoot
CUtil.launchOnTimer(300,function():void
{ snap = ImageSnapshot.captureImage(htopCanvas, dpi, pngenc);
ihm.savesnap(_this,snap.data);
});
return realdpi;
}
// send pictures
private var zipout:ByteArray; // le zip final
private var urlheader:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
private var urlldr:URLLoader = new URLLoader();
private var zURLRequest:URLRequest;
public function sendFinalImages():void
{
urlldr.addEventListener(ProgressEvent.PROGRESS,function(event:ProgressEvent):void
{
});
urlldr.addEventListener(Event.COMPLETE, function(event:Event):void
{
if(urlldr.data == "okokoko")
Alert.show(":)",":D",4,null,wellDone);
else {
Alert.show("error : "+urlldr.data);
}
});
urlldr.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
urlldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
urlldr.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
var zip:FZip = new FZip();
zURLRequest = new URLRequest(CUtil.getScriptUrl()+"save.php?saveid="+saveid);
zURLRequest.requestHeaders.push(urlheader);
zURLRequest.method = URLRequestMethod.POST;
var outtxt:ByteArray = new ByteArray;
var nbsnap:uint = 0;
for each (var snp:ByteArray in snapArray)
{ zip.addFile("page"+nbsnap.toString()+".png", snp, true);
nbsnap++;
}
var zipout:ByteArray = new ByteArray;
zip.serialize(zipout);
zURLRequest.data = zipout;
urlldr.load(zURLRequest);
}
// here your php script, here it only save the receved file on server :
<?php
if(isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{ $file = 'final/'.$_GET['saveid'].'.zip';
$handle = fopen($file,'w');
fwrite($handle, $GLOBALS["HTTP_RAW_POST_DATA"]);
fclose($handle);
print 'okokoko';
}
?>
do the same, but send only your picture instead of a zip,
save it on the server, and launch the pdf generating on the same time, using the saved picture ...