# Drawing Board

**URL:** <https://forum.kirupa.com/t/drawing-board/57560>\
**Category:** flash\
**Created:** [July 14, 2004, 9:23am UTC](https://forum.kirupa.com/t/drawing-board/57560 "2004-07-14T09:23:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ann\_Yoshimi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ann_yoshimi/32/633_2.png) [@Ann\_Yoshimi](https://forum.kirupa.com/u/Ann_Yoshimi)\
**Post date:** [July 14, 2004, 9:23am UTC](https://forum.kirupa.com/t/drawing-board/57560/1 "2004-07-14T09:23:18Z")

</div>

I need to know how to script the drawing board as in the user can only draw on a specified area.For example, on a 800x600 layout, only 1/4 of it is the drawing board.After the user has drawn the image, when he/she clicks on a button, the image will be replicated on another area in the same 800x600 space.  
So far, i can only manage to make a drawing board on the whole 800x600 space and erasing. Seriously need help…

---

<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:** [July 14, 2004, 5:00pm UTC](https://forum.kirupa.com/t/drawing-board/57560/2 "2004-07-14T17:00:13Z")

</div>

Why don’t you make your drawing board a movie clip that has some onClipEvent handlers like:

onPress() … draw  
onRelease … stop drawing

Mike

> [@Ann\_Yoshimi](#):
>
> I need to know how to script the drawing board as in the user can only draw on a specified area.For example, on a 800x600 layout, only 1/4 of it is the drawing board.After the user has drawn the image, when he/she clicks on a button, the image will be replicated on another area in the same 800x600 space.  
> So far, i can only manage to make a drawing board on the whole 800x600 space and erasing. Seriously need help…

---

<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:** [July 15, 2004, 12:48am UTC](https://forum.kirupa.com/t/drawing-board/57560/3 "2004-07-15T00:48:36Z")

</div>

> [@mariachi77](#):
>
> Why don’t you make your drawing board a movie clip that has some onClipEvent handlers like:
> 
> onPress() … draw  
> onRelease … stop drawing
> 
> Mike

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…
