# Smoother drawing board

**URL:** <https://forum.kirupa.com/t/smoother-drawing-board/118214>\
**Category:** Uncategorized\
**Created:** [August 3, 2004, 5:59pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214 "2004-08-03T17:59:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)\
**Post date:** [August 3, 2004, 5:59pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/1 "2004-08-03T17:59:02Z")

</div>

this morning i suddenly remembered a post a while back about some one wanting to smooth lines drawn using the drawing api from the drawing board tut an i thout of the simple solution - dont do it from the mouse, do it from an eased mc which follows the mouse.  
so i simply combined the 2 tuts (one for mouse following with easing and the drawing board tut) and came up with attached…  
one problem tho the post doesnt turn up in searches (too old i presume… god only knows how old the post was!! :S lol)  
but neway… if whoever it was is stil lookin for the answer, here tis…

Prophet.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [August 3, 2004, 6:12pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/2 "2004-08-03T18:12:33Z")

</div>

pretty clever prophet. Thanks for sharing! 🙂

There is one problem, however. If you move your mouse very fast and then stop it, the pencil will continut to move but no lines will be drawn :x

Might need an enterframe event in there to take up for that lost slack. 😉

---

<div class="post-metadata">

**Author:** ![sirtimbly](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@sirtimbly](https://forum.kirupa.com/u/sirtimbly)\
**Post date:** [August 3, 2004, 6:28pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/3 "2004-08-03T18:28:17Z")

</div>

too tight! I likes this, not sure where I might use it but hey… awesome!

---

<div class="post-metadata">

**Author:** ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)\
**Post date:** [August 3, 2004, 9:24pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/4 "2004-08-03T21:24:50Z")

</div>

yer i noticed that… a slight movement solves it… but hey, i gotta say - i am surprised - i was expectin ppl 2 say “o its obv bn done b4” and slaggin me off for bein slow etc… but instead i get praised from senocular… NICE! 😉 lol

just seemed logical to me is all…

did as u suggested and hey presto, waddya know joe it works 😉  
cheers sen!

Prophet.

EDIT:- the fla mysteriously compressed itself a bit in uploading to kirupa… if ne1 has probs with the file ill upload agen but for now im goin 2 bed coz i hav headache :S

---

<div class="post-metadata">

**Author:** ![Jerryscript](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jerryscript/32/451_2.png) [@Jerryscript](https://forum.kirupa.com/u/Jerryscript)\
**Post date:** [August 4, 2004, 10:34pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/5 "2004-08-04T22:34:04Z")

</div>

If possible, could you post the AS used as a txt file? I don’t use the Flash IDE, so I can’t view FLAs, but I would love to look at your code! Even a SWF I could decompile would be great!

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)\
**Post date:** [August 5, 2004, 6:32pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/6 "2004-08-05T18:32:35Z")

</div>

erm sure…

this code on frame1:

```auto
_root.createEmptyMovieClip("line",0)
line.swapDepths(pencil)

```

and this code on the mc:

```auto
onClipEvent (load) {
	_x = 0
	_y = 0
	speed = 5
}
onClipEvent (enterFrame) {
	endX = _root._xmouse
	endY = _root._ymouse
	_x += (endX-_x)/speed
	_y += (endY-_y)/speed
	
// Code to draw the line to the pencil point
	_root.onMouseDown = function(){
		_root.line.moveTo(_root.pencil._x,_root.pencil._y)
		_root.line.lineStyle(2,0x000000,100)
		this.onMouseMove = function(){
			_root.line.lineTo(_root.pencil._x,_root.pencil._y)
			updateAfterEvent()
		}
	}
//Code to stop the drawing when the mouse is NOT down
	_root.onMouseUp = function(){
		this.onMouseMove = null
	}
}

```

it really is simply combining two tuts! the lines will draw to the mc you put the above code on (instance name of _pencil_) erm… the swf is here: [http://www.freewebs.com/pweb/drawing%20easing.swf](http://www.freewebs.com/pweb/drawing%20easing.swf)

Prophet.

---

<div class="post-metadata">

**Author:** ![Jerryscript](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jerryscript/32/451_2.png) [@Jerryscript](https://forum.kirupa.com/u/Jerryscript)\
**Post date:** [August 6, 2004, 3:48pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/7 "2004-08-06T15:48:38Z")

</div>

Thanks Prophet, nice work! 🙂

---

<div class="post-metadata">

**Author:** ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)\
**Post date:** [August 6, 2004, 5:49pm UTC](https://forum.kirupa.com/t/smoother-drawing-board/118214/8 "2004-08-06T17:49:58Z")

</div>

meh, salrite aint it 😛 lol  
seriously, its nothing… im quite surprised its not been done before to be perfectly honest!!

Prophet.
