# Mask with drawing api problem

**URL:** <https://forum.kirupa.com/t/mask-with-drawing-api-problem/78267>\
**Category:** Uncategorized\
**Created:** [February 3, 2005, 7:19am UTC](https://forum.kirupa.com/t/mask-with-drawing-api-problem/78267 "2005-02-03T07:19:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dora](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@dora](https://forum.kirupa.com/u/dora)\
**Post date:** [February 3, 2005, 7:19am UTC](https://forum.kirupa.com/t/mask-with-drawing-api-problem/78267/1 "2005-02-03T07:19:59Z")

</div>

there is problem when i mask with movie clip (\_root.mask)  
I draw 2 rectangle and fill it but have hole in the center.  
When mask why it mask full rectangle .  
( I want to be hole in the center of rectangle)

this is my code

MovieClip.prototype.drawRect = function(x, y, w, h) {  
this.moveTo(x, y);  
this.lineTo(x+w, y);  
this.lineTo(x+w, y+h);  
this.lineTo(x, y+h);  
this.lineTo(x, y);

}

\_root.createEmptyMovieClip(“mask”,\_root.getNextHighestDepth());  
\_root.mask.lineStyle(0,0,100);  
\_root.mask.beginFill(0,100);  
\_root.mask.drawRect(200,200,150,150);  
\_root.mask.drawRect(250,250,50,50);  
\_root.mask.endFill();  
mc.setMask(\_root.mask);
