Masked line

Hi again. :slight_smile:
Can I do a mask for the lines? Or a area where I can draw, and outside the area I can not draw… Understand what I mean?
<{([FLASH: MX 2004])}>

 var thickness = 1;  //Thickness of line 
var lcolour = "0x000000";  //Colour of line 
var scolour = "0x999999"; //Colour of fill 
var linjealpha = 100;  //Transparency of the linje 
var mDown = false; 
var startx, starty, endx, endy; 
//Gets the starting point when mouse is clicked 
this.onMouseDown = function() {
	var id:Number = _root.getNextHighestDepth() 
	linje = _root.createEmptyMovieClip("linje_" + id, id) 
	mDown = true; 
	startx = _xmouse; 
	starty = _ymouse; 
}; 
//When mouse is released stop drawing linje 
this.onMouseUp = function() {
	 mDown = false; 
}; 
//Do all the commands 
this.onEnterFrame = function() { 
   //Get the mouse coordinates 
   endx = _xmouse; 
   endy = _ymouse; 
   //Destroy current linje to prepare for new one 
	
   //Draw the linje if mouse is down 
   if (mDown) {  
	  linje.clear();
	  //linje.beginFill(scolour, linjealpha);
   linje.lineStyle(thickness, lcolour, linjealpha);
	  linje.moveTo(startx, starty); 
	  //linje.lineTo(endx, starty); 
	  linje.lineTo(endx, endy); 
	  //linje.lineTo(startx, endy); 
	  //linje.lineTo(startx, starty); 
	  //linje.endFill(); 
   } 
};
stop();