Hey peeps, im trying to make a simple drawing board which will let the user select different colours using a paintbrush. I cant figure out how to go about it tho!!! If anyone can help with the code, id be very greatful. :pleased:
Code:
// Enables The Drawing Canvas
_root.onMouseDown = function() {
if (_root.canvas_mc.hitTest(_root._xmouse, _root._ymouse)) {
var x:Number = _root._xmouse;
var y:Number = _root._ymouse;
_root.holder_mc.moveTo(x, y);
down = true;
}
};
_root.onMouseUp = function() {
down = false;
};
var currentColor:String = “0x000000”;
_root.createEmptyMovieClip(“holder_mc”, 100);
function draw() {
_root.holder_mc.lineStyle(2, parseInt(currentColor, 16), 100);
var x:Number = _root._xmouse;
var y:Number = _root._ymouse;
_root.holder_mc.lineTo(x, y);
}
_root.onMouseMove = function() {
updateAfterEvent();
if (down && _root.canvas_mc.hitTest(_root._xmouse, _root._ymouse)) {
draw();
}
};
Paintbrush:
on (release) {
_root.fillColor = 0x00FF00;
_root.brush.gotoAndStop(4);
}