# Draw in MX; how do I add a mask to limit drawing space?

**URL:** <https://forum.kirupa.com/t/draw-in-mx-how-do-i-add-a-mask-to-limit-drawing-space/1627>\
**Category:** flash\
**Created:** [May 17, 2002, 6:07pm UTC](https://forum.kirupa.com/t/draw-in-mx-how-do-i-add-a-mask-to-limit-drawing-space/1627 "2002-05-17T18:07:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 17, 2002, 6:07pm UTC](https://forum.kirupa.com/t/draw-in-mx-how-do-i-add-a-mask-to-limit-drawing-space/1627/1 "2002-05-17T18:07:15Z")

</div>

Ive managed to create other colors by adding new movieclips. But how do I mask off the drawing board to limit where the lines are drawn?

Is it another level on top with a mask? )if you are even able to mask through levels…)

Or somehow restricting the movement of the new “line” movieclip?

Note the usage of “somehow”, because i dont know…

Thanks!  
georgekaplin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 17, 2002, 8:11pm UTC](https://forum.kirupa.com/t/draw-in-mx-how-do-i-add-a-mask-to-limit-drawing-space/1627/2 "2002-05-17T20:11:30Z")

</div>

You can draw a big square on your scene, turn it into a movie clip, give it the instance name ‘mask’, and then add this code to the rest of the code :

```auto
 _root.setMask (mask) ;

```

I guess you could as well use the drawing API to draw dynamically the mask.

pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 20, 2002, 1:17pm UTC](https://forum.kirupa.com/t/draw-in-mx-how-do-i-add-a-mask-to-limit-drawing-space/1627/3 "2002-05-20T13:17:13Z")

</div>

Can you mask through layers?

If the set mask is on \_level2, will it affect \_level1?

Im creating a drawing file based off the tutorial and am trying to limit the drawing field so as not to scribble on the erase button.

thanks.
