# Creating a sketch book

**URL:** <https://forum.kirupa.com/t/creating-a-sketch-book/234752>\
**Category:** programming\
**Created:** [August 5, 2007, 7:48pm UTC](https://forum.kirupa.com/t/creating-a-sketch-book/234752 "2007-08-05T19:48:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose3760](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jose3760/32/2887_2.png) [@jose3760](https://forum.kirupa.com/u/jose3760)\
**Post date:** [August 5, 2007, 7:48pm UTC](https://forum.kirupa.com/t/creating-a-sketch-book/234752/1 "2007-08-05T19:48:19Z")

</div>

Hey, ive created a sketch book that allows the user to basically draw whatever, but im having trouble with buttons that allow you to change the colour of the line.

heres the code on an empty mc:

onClipEvent(load){  
draw = false;  
\_root.lineStyle(1,0x000000, 100);  
}  
onClipEvent(mouseDown){  
draw = true;  
\_root.moveTo(\_root.\_xmouse,\_root.\_ymouse);  
}  
onClipEvent(mouseUp){  
draw = false;  
}  
onClipEvent(enterFrame){  
if(draw){  
\_root.lineTo(\_root.\_xmouse,\_root.\_ymouse);  
}  
}

and the code on the button: (would be the red button)

on(release){  
\_root.lineStyle(1,0xFF0000, 100);  
}
