package { import flash.display.BitmapData; import flash.display.Shape; import flash.display.Sprite; import flash.geom.Matrix; public class as7 extends Sprite { public function as7() { draw(); } private function makeBitmapData():BitmapData { var bitmap:BitmapData = new BitmapData(100,100); bitmap.perlinNoise(40, 40, 2, Math.random(), true, false); return bitmap; } private function draw():void { var bitmap:BitmapData = makeBitmapData(); var widht:Number = stage.stageWidth/2; var height:Number = stage.stageHeight/2; var radius:Number = 70; var shape:Shape = new Shape(); with(shape.graphics) { beginBitmapFill(bitmap); drawRoundRect(0, 0, widht, height, radius, radius); endFill(); } addChild(shape); shape = new Shape(); var matrix:Matrix = new Matrix(); matrix.translate((width-bitmap.width)/2,(height-bitmap.height)/2); with (shape.graphics) { beginBitmapFill(bitmap, matrix, false); drawRoundRect(0, 0, width, height, radius, radius); endFill(); } shape.x = width; addChild(shape); shape = new Shape(); matrix.rotate(Math.PI/4); with(shape.graphics) { beginBitmapFill(bitmap, matrix, false); drawRoundRect(0, 0, width, height, radius, radius); endFill(); } shape.y = height; addChild(shape); shape = new Shape(); matrix = new Matrix(); matrix.scale(20,20); with(shape.graphics) { beginBitmapFill(bitmap, matrix, false, false); drawRoundRect(0, 0, width, height, radius, radius); endFill(); } shape.x = width; shape.y = height; addChild(shape); } } }