Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.events.Event;
- import flash.display.*;
- import flash.geom.*;
- import flash.utils.*;
- import flash.filesystem.*
- addEventListener(Event.ENTER_FRAME,eFrame);
- var bmd:BitmapData=new BitmapData(stage.stageWidth,stage.stageHeight);
- var all:Rectangle=new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
- var opts:Object=new PNGEncoderOptions(true);
- var basePath:String=File.desktopDirectory.nativePath+File.separator+"dump"+File.separator;
- var i:uint=0;
- eFrame(null);
- function eFrame(e:Event):void {
- bmd.fillRect(all,0x00000000);
- bmd.drawWithQuality(root,null,null,null,null,true,StageQuality.HIGH_16X16);
- var ba:ByteArray=bmd.encode(all,new PNGEncoderOptions(true));
- var f:File=new File(basePath+i+".png");
- var fs:FileStream=new FileStream();
- fs.open(f,FileMode.WRITE);
- fs.writeBytes(ba);
- fs.close();
- ++i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement