Drawing api tutorial

Yo. I’m using some code from this tutorial on a project

http://www.kirupa.com/developer/actionscript/drawingboard.htm

and I need to modify it so that you can only draw on certain areas of the screen. I chucked in an if (_xmouse < 118) but that just means you can’t start drawing past 118 and you can still start before 118 and drag all over. I imagine a mask or summat should do the trick but I’m not sure where the lines actually are in terms of layers or levels. Can I load in something to cover it on a level above? Or anything? Cheers in advance.