Need help to setup the drawing area

Hi, I already create a program that can draw a line. The problem is, I want to let user can draw the line only within the gray area.

Already upload the files.

And this is the code. The gray area, I already convert it into a movie clips, and name it as “area”


this.onMouseDown = function() 
{ 
    var n:Number = this.getInstanceAtDepth(); 
    var mc:MovieClip = this.createEmptyMovieClip("mc" + n, n); 


    var x0:Number = _xmouse; 
    var y0:Number = _ymouse;




    this.onMouseMove = function() 
    { 
        mc.clear();
        mc.lineStyle(10, 0xFFFF99, 50, true, normal, round);
        mc.moveTo(x0,y0); 
        mc.lineTo(_xmouse,_ymouse);


        updateAfterEvent(); 
    }; 
}; 


this.onMouseUp = function() 
{ 
    delete this.onMouseMove; 
};