Jump to content


taking a screenshot of autofitarea moviclips using bitmapData.draw()

Recommended Posts



I'm trying to take a screenshot of the stage which is made up of various Movieclips blending and filling the entire stage using autofitarea.


the problem is none of the movieclips in the autofitarea show up in the screenshot - and if i do select a movieclip to export it is the original size not the scaled size

var area:AutoFitArea = new AutoFitArea(this,0,0,stage.stageWidth,stage.stageHeight);
   area.attach(mc, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE, crop:true});
   area.attach(mc2, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE, crop:true});
   area.attach(mc3, {scaleMode:ScaleMode.PROPORTIONAL_OUTSIDE, crop:true});

function SaveScreenshot(evt:MouseEvent):void{
   var bitmapData:BitmapData=new BitmapData(area.width, area.height);

   var jpgEncoder:JPGEncoder = new JPGEncoder(100);
   var byteArray:ByteArray = jpgEncoder.encode(bitmapData);

   byteArray = jpgEncoder.encode(bitmapData);

   var fileReference:FileReference=new FileReference();
   fileReference.save(byteArray, "scrShot1.jpg");

// neither mc, mc2 or mc3 show in the exported jpg, while everything else on the stage does

really hope someone can help me with this



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.