//准备一个40*40绿色背景的BitmapData var myBitmapData: BitmapData = new BitmapData(40, 40, false, 0x0000FF00); //画二个有“交叉重叠”部分的“蓝色”矩形 var rect: Rectangle = new Rectangle(0, 0, 25, 25); myBitmapData.fillRect(rect, 0x000000FF); rect = new Rectangle(20, 20, 20, 20); myBitmapData.fillRect(rect, 0x000000FF); //从坐标(10,10)开始寻找与(10,10)坐标(像素点相同且连续的区域)填充红色 myBitmapData.floodFill(10, 10, 0x00FF0000); var bm: Bitmap = new Bitmap(myBitmapData); addChild(bm); bm.scaleX = bm.scaleY = 3.0; bm.x = stage.stageWidth / 2 - bm.width / 2; bm.y = stage.stageHeight / 2 - bm.height / 2;