Drawing Board

This is how my script looks but i need the drawing to be restrain to only part of the stage.That means the user can only draw on this particular square area on the stage.The user can’t draw on any other parts of the stage except the specified one.

_root.onMouseDown = function(){
_root.lineStyle(5, 0x000000, 100);
_root.moveTo(_root._xmouse, _root._ymouse);
isDrawing = true;
};
_root.onMouseMove = function() {
if (isDrawing == true) {
_root.lineTo(_root._xmouse, _root._ymouse);
updateAfterEvent();
}
};
_root.onMouseUp = function() {
isDrawing = false;
};
clear_btn.onRelease = function() {
_root.clear();
};

Anyway, thanks for the reply…