0
votes

I'm trying to mask a movieclip using a mask created with AS3 but it changes the color of the movieclip being masked. I would like the mask to not change the color of the masked movieclip. Here is my code:

mask_mc.mask=masked_mc;

drawMask();

function drawMask():void {
   mask_mc.graphics.clear();
   mask_mc.graphics.beginFill(0x000000,1);
   mask_mc.graphics.drawRect(0,0,750,250);
   mask_mc.graphics.endFill();
}

The masked movieclip becomes the same color as the color defined in beginFill. In the example above, masked_mc turns black (as defined in beginFill). Removing beginFill masked everything and revealed nothing. I've not found anyone else having this problem. Perhaps I going about this all wrong. Thanks in advance for any help on masking with AS3 without changing the color of the movieclips being masked.

1

1 Answers

0
votes

You also have to add the mask into the display list :

SomeClip.addChild(masked_mc)

and i see that you are drawing on your clip and not on your mask so it may explain the color you see :

var g:Graphics = masked_mc.graphics
g.clear()
g.beginFill(0x000000,1)
g.drawRect(0,0,750,250)
g.endFill()