开发者

Flash inverted mask

开发者 https://www.devze.com 2022-12-19 12:23 出处:网络
I\'ve been looking for a simple way to invert a mask in flash. Its just amazing how it doesn\'t have this feature.

I've been looking for a simple way to invert a mask in flash. Its just amazing how it doesn't have this feature.

I just really need to paint shape and whatever is below (in layers) wo开发者_如何学Pythonnt show up.

Any suggestions?


To create an inverted mask in code do the following

private function createInvertedMask(mcToBeMasked:MovieClip):void {

        mcToBeMasked.blendMode = BlendMode.LAYER;
        var invertedMask:Sprite = new Sprite();
        invertedMask.graphics.beginFill(0x0, 1);
        invertedMask.graphics.drawRect(640, 395, 630, 395);
        invertedMask.blendMode = BlendMode.ERASE;
        mcToBeMasked.addChild(invertedMask);
    }

To create an inverted mask in the Flash Professional IDE Choose the properties panel of the image you want masked, select "Display" -> "Blending" -> "Layer" Then select your mask, and choose "Display -> "Blending" -> "Erase" You'll see something like this:

Flash inverted mask


NOTE: Remember for this to work inside a movie clip (i.e. you have created an inverted animated mask movie clip that will erase itself etc); the movie clip in which it is embedded MUST BE SET TO BLENDMODE: LAYER ALSO otherwise the overall effect will be ignored - hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消