# Draw in specific area - custom cursor?

**URL:** <https://forum.kirupa.com/t/draw-in-specific-area-custom-cursor/295789>\
**Category:** flash\
**Created:** [September 4, 2009, 10:15am UTC](https://forum.kirupa.com/t/draw-in-specific-area-custom-cursor/295789 "2009-09-04T10:15:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scotia2k6](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@scotia2k6](https://forum.kirupa.com/u/scotia2k6)\
**Post date:** [September 4, 2009, 10:15am UTC](https://forum.kirupa.com/t/draw-in-specific-area-custom-cursor/295789/1 "2009-09-04T10:15:21Z")

</div>

Hello All - wee update / better description

Id like to be able to use a pencil image (custom cursor?) to draw in a defined area - its the 'ol pencil drawing a line idea on a pad. I dont know how to define the area? Ive tried creating either a btn or mc instance called pad\_mc & trying rollOver/Out which confines the pen but not the line.

This is what I have so far, which works (ie it draws the line) but obviously it goes everywhere, not just over the mc of the pad.

```auto
 
createEmptyMovieClip("Line",1);
Line.lineStyle(1, 0x666666, 65);
 
//
 
onMouseDown = function () {
 Mouse.hide();
 pen_mc.startDrag(true);
 pen_mc.swapDepths(100);
 Line.moveTo(_xmouse,_ymouse);
 onMouseMove = function () {
  Line.lineTo(_xmouse,_ymouse);
 };
};
onMouseUp = function () {
 Mouse.show();
 pen_mc.stopDrag();
 onMouseMove = null;
};

```

Also, Ive got an onClipEvent on my pen\_mc to try & help define where its allowed to be dragged. Im really stumped & any advice is very welcome!

Thanks in advance & have added my wee file, scotia
