# Using shape as mask

**URL:** https://forum.kirupa.com/t/using-shape-as-mask/250396
**Category:** Uncategorized
**Created:** [January 29, 2008, 8:13am UTC](https://forum.kirupa.com/t/using-shape-as-mask/250396 "2008-01-29T08:13:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chosen1](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chosen1](https://forum.kirupa.com/u/chosen1)
#### Post date: [January 29, 2008, 8:13am UTC](https://forum.kirupa.com/t/using-shape-as-mask/250396/1 "2008-01-29T08:13:55Z")

</div>

hey guys,

Just having an issue with using a shape as a mask. I basically draw onto an empty shape object i create using its graphics property. This works as i can see it once i use addChild however a problem arises when i draw say 2 (or more) separate rectangles and set the shape as a mask on a movieclip. The area (the seperate rectangles) defined to be the mask along with the area inbetween the seperate rectangles becomes the mask.

```auto

beginFill(0x0000ff, 1.0);
drawRect(10, 10,50, 10);
drawRect(10, 30,50, 10);
endFill();

```

so using the above code as an example, the rectangles drawn are independant, i.e they dont overlap. However when i set mc.mask, the area inbetween the rectangles also become part of the mask, which is not what i want.

Any help would be greatly appreciated on getting round this…Thanks!
