
Ok you want to take a snapshot of a movieclip, sprite, displayobject, shape or just simply the whole stage?
That is a simple task to accomplish in AS3. Below a reusable function I wrote while working for one of our clients:
private function getBitmapData( target:DisplayObject ) : BitmapData { if ( bd ) { bd = null; } //target.width and target.height can also be replaced with a fixed number. var bd : BitmapData = new BitmapData( target.width, target.height ); bd.draw( target ); return bd; }
you want to display the captured bitmapdata on the stage or inside of a Sprite? Again this is no problem:
private function displayCapturedBitmapData():void { var bmp:Bitmap = new Bitmap( getBitmapData( myImage ) ); addChild(bmp); }
That’s it, now you know how to create screenshots of your flash movie.

The AS3: Take a screenshot of any Displayobject by Tiago's Weblog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.5 Switzerland License.




This only work for bitmaps less than I think 4000 pixels wide. That is unless Adobe increased that limit. You can go up to 10,0000 pixels with a custom class. If you Google unlimitedBitmapdata you should be able to find a blog post about such a custom class.
Thanks for the comment Jason, when using Flash Player 10 you can use a total of 16’777’215 pixels, which would mean a square of roughly 4095×4095 pixels.
That doesn’t mean that the max width of a bitmapdata is 4095 it can be whichever width you want as long as the total amount of pixels is equal or less than 16’777’215 pixels. Not sure if FP10.1 raised the bar again, but at the end, I don’t think that anyone wants to create such high bitmapdatas and if they do then they can easily split them as they need.
Hi,
what about snapshottnh a 3d object?
Suppose I have a Sprite, then i Rotate it and move it in the 3d space.
Then I want to snapshot the rotated&moved sprite, how can I do that?
thanks
That’s basically the same, the snapshot is being created of the current visible portion of the screen of the defined Sprite.
Hi.
Is it possible to take a print screen of the stage using flash cs4 as3?
Yep absolutely, you can use the same method like i’ve shown in this post.