Возможно, с помощью комбинации LAYER и ERASE BlendMode будет делать то, что вы хотите:
Пример:
import flash.display.BlendMode;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.geom.Rectangle;
public class PunchTest extends Sprite {
private var punchSprite:Sprite = new Sprite();
public function doPunch(target:Sprite, rect:Rectangle):void {
var g:Graphics = punchSprite.graphics;
g.clear();
g.beginFill(0, 1);
g.drawRect(rect.x, rect.y, rect.width, rect.height);
g.endFill();
punchSprite.blendMode = BlendMode.ERASE;
target.blendMode = BlendMode.LAYER;
target.addChild(punchSprite);
}
public function PunchTest() {
super();
var g:Graphics = graphics;
// draw a red backgound
g.beginFill(0xff0000, 1);
g.drawRect(0, 0, 500, 500);
g.endFill();
// add a blue coverring sprite at 0.5 alpha
var coverSprite:Sprite = new Sprite();
g = coverSprite.graphics;
g.beginFill(0x00ff00, 0.5);
g.drawRect(50, 50, 300, 300);
g.endFill();
addChild(coverSprite);
// do a hole into the cover sprite
doPunch(coverSprite, new Rectangle(80, 80, 100, 100));
}
}