在动作3中掩盖和揭露

时间:2013-02-18 19:56:22

标签: actionscript-3 masking

我为图像创建了一个遮罩。现在我想知道如何才能知道图像是否已完全显示?这是代码......

var sc : Scratch_card = new Scratch_card ();
var bg: Background = new Background ();
var mouseclick:Number;
var masking:Sprite = new Sprite()

addChild (sc);
sc.x=20;
sc.y=40;

addChild (bg);
bg.x=20;
bg.y=40;
addChild(masking);
bg.mask = masking;


stage.addEventListener(MouseEvent.MOUSE_DOWN, prsing);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mving);
stage.addEventListener(MouseEvent.MOUSE_UP, lfting);


function prsing(event:MouseEvent):void {
mouseclick = 1;
}


function mving(event:MouseEvent):void {
if (mouseclick == 1) {
masking.graphics.beginFill(0x000000);
masking.graphics.drawEllipse(mouseX, mouseY, 70, 60);
masking.graphics.endFill();

}
}


function lfting(event:MouseEvent){
mouseclick = 0;
}

我如何才能知道图像是否真的以代数方式取消掩盖......

编辑:

    function lfting(event:MouseEvent){
if (masking.x - masking.width < bg.x ){
    trace ("u cleaned it");
}
    mouseclick = 0;
    }

0 个答案:

没有答案