I'm making a drawing application in Flash with action script 2.
I want a button to save the screen and than open the image in a browser window, I thought this should work but it doesn't at all. It says there doesn't exists any file yet. Does anyone know how to create something like that?
My code:

Code:
import flash.display.BitmapData;
ExportButton.onPress = function () {
output ();
};
function output () {
snap = new BitmapData (dar._width, dar._height);
snap.draw (dar);
var pixels:Array = new Array ();
var w:Number = snap.width;
var h:Number = snap.height;
for (var a:Number = 0; a <= w; a++) {
for (var b:Number = 0; b <= h; b++) {
var tmp = snap.getPixel (a, b).toString (16);
pixels.push (tmp);
}
}
var output:LoadVars = new LoadVars ();
output.img = pixels.toString ();
output.height = h;
output.width = w;
output.send ("show.php","output","POST");
}
stop ();