Mask with drawing api problem

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);