It's been a few years since i've swished or actionscripted with MM. Maybe one of you pros can help me
connect the dots. I need to save my stage to jpg image. I'm able to pass a block to php script
to save image to the server, but i can't seem to set my stage/scene view to the BitmapData.

I have an application where users are building a design layout and I need to save the work to the
server once they click the save button.

How do I assign the stage/active scene to the BitmapData? I'm using Max4.



function CreateSnapClick() {
//create block on scene
Bitmap_Data = flash.display.BitmapData;
img_object_1 = new Bitmap_Data(715, 328, false, 0x78A240);
img_object_1.draw();

//add stage and img_object_1 to snapshot
myShoot.attachBitmap(img_object_1, 1);
myShoot._x = 0;
myShoot._y = 0;

}

function SaveSnapClick() {

var snap = img_object_1;

var pixels:Array = new Array();
var w:Number = 715;
var h:Number = 328;

trace("Dimensione X:" + w + " Dimensione Y:" + h);

for (var a = 0; a < w; a++) {
for (var b = 0; b < h; b++) {
var tmp = snap.getPixel(a, b).toString(16);
pixels.push(tmp);
}
}
trace("Size: " + pixels.length );

var output:LoadVars = new LoadVars();

output.img = pixels.toString();
output.height = h;
output.width = w;
output.Submit = 1;
output.onLoad = function (success) {
if(success) {
trace("Success");
} else {
trace("Failure");
}
}

fscommand("postData", h + "|" + w + "|" + output.img);

output.send("save.php?page", "_self" , "POST");
}


Example
http://www.renewman.com/savesnap/index.html
Source
http://www.renewman.com/savesnap/savesnap.swi