绘制镂空区域

var c:Sprite = this["c0"];
c.addEventListener(MouseEvent.CLICK,onClick);

var sp:Sprite = new Sprite();
addChild(sp);
sp.graphics.beginFill(0x000000,0.5);
sp.graphics.drawRect(0,0,200,200);
sp.graphics.lineStyle(1,0xffff00);
sp.graphics.drawRect(50,50,100,100);
sp.graphics.endFill();
function onClick(event:MouseEvent):void
{
    trace(event.target.name);
}

 

posted @ 2016-06-01 11:45  泥潭里的金鱼  阅读(209)  评论(0编辑  收藏  举报