var bmd: BitmapData = new BitmapData(80, 30, false, 0xFF0000); var cTransform: ColorTransform = new ColorTransform(); cTransform.alphaMultiplier = 0.8; //设置透明度因子为0.8 var rect: Rectangle = new Rectangle(0, 0, 40, 30); //定义左半边矩形区域 bmd.colorTransform(rect, cTransform); //对rect区域应用colorTransform var bm: Bitmap = new Bitmap(bmd); addChild(bm); bm.x = stage.stageWidth / 2 - bm.width / 2; bm.y = stage.stageHeight / 2 - bm.height / 2;