# Need help to setup the drawing area

**URL:** <https://forum.kirupa.com/t/need-help-to-setup-the-drawing-area/329489>\
**Category:** flash\
**Created:** [September 5, 2012, 10:19am UTC](https://forum.kirupa.com/t/need-help-to-setup-the-drawing-area/329489 "2012-09-05T10:19:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PLa5teRz](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@PLa5teRz](https://forum.kirupa.com/u/PLa5teRz)\
**Post date:** [September 5, 2012, 10:19am UTC](https://forum.kirupa.com/t/need-help-to-setup-the-drawing-area/329489/1 "2012-09-05T10:19:51Z")

</div>

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”

```auto

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

```
