import flash.display.BitmapData; //导入BitmapData 类
var mybmp:BitmapData=new BitmapData(Stage.width,Stage.height,false,0); //建立一个和场景一样大的位图对象
this.attachBitmap(mybmp,1); //将位图图像附加到主场景上
//----效果部分 建立一个mymc 内部建立一个line 绘制一条直线 每帧随机旋转一个角度-----//
this.createEmptyMovieClip("mymc", 2);
mymc.createEmptyMovieClip("line", 1);
with(mymc.line){
lineStyle(5, 0x00FFFF, 30);
moveTo(0, 0);
lineTo(20, 20);
}
mymc.onEnterFrame=function(){
this.line._x=this._xmouse;
this.line._y=this._ymouse;
this.line._rotation=Math.random()*360;
}
//----------------效果部分结束-------------------------//
this.onEnterFrame=function(){
mybmp.draw(this); //不停的描绘场景
}
转载于:https://www.cnblogs.com/pelephone/articles/flash-create-bitmap-jpg.html