Is this possible?:
I would like to take a snapshot of the contents of the stage at some point in time. The snapshot would be some kind of image data which I can then mess around with. At the point where I want to take the snapshot, the stage will contain images and movieclips contained in the originally loaded SWF, as well as images and movieclips loaded from other SWFS that were loaded dynamically using flash.display.Loader class and attached to the Stage
Thanks
Yes, using the bitmapdata class.
Thanks for the reply, Ajcates.
Can someone mention a couple of words on the technique of using this class to accomplish this? I’ve been looking online but having found references, yet.
I’ve done this before as a small cog in a complex infinite fractal application I once made for a client.
First you have to have everything on the stage in one MC and have cacheAsBitmap set to true on that MC.
Then it’s something like:
var bitmap:BitmapData = new Bitmap(stageMC.width, stageMC.height)
bitmap.draw(stageMC);
var image:Bitmap = new Bitmap(bitmap);
The image var should reference a snapshot of the component. You can add it to another MC, send it to a server, or in flash 10 save it to your user’s hardrive.
Thank you very much, Ikinsey, for that very nice, detailed, response.