Combined Code
movieClip 2 eventHandler {
}
movieClip 4 brushTool {
frame 1 {
this.onEnterFrame = function () {
mcColor = new Color(this);
mcColor.setRGB(_root.brushColor);
};
}
}
movieClip 6 {
}
movieClip 7 brushTip {
frame 1 {
this.onEnterFrame = function () {
movement = _parent._xmouse - this._x;
this._x += movement * 0.9;
movement = _parent._ymouse - this._y;
this._y += movement * 0.9;
};
}
}
frame 1 {
this.onEnterFrame = function () {
if (Key.isDown(40) && brushSize > 1) {
_root.brushTip._height -= 5;
_root.brushTip._width -= 5;
}
if (Key.isDown(38)) {
_root.brushTip._height += 5;
_root.brushTip._width += 5;
}
brushSize = _root.brushTip._height;
if (Key.isDown(1)) {
this.lineStyle(_root.brushSize, _root.brushColor, 100);
this.lineTo(_root.brushTip._x, _root.brushTip._y);
}
};
}
instance of movieClip 2 eventHandler {
onClipEvent (load) {
this.moveTo(55, 555);
_root.brushSize = _root.brushTip._height;
r = random(256) & 255;
g = random(256) & 255;
b = random(256) & 255;
hexR = r.toString(16);
hexG = g.toString(16);
hexB = b.toString(16);
hex_color = hexR + hexG + hexB;
_root.brushColor = '0x' + hex_color;
this.lineStyle(_root.brushSize, _root.brushColor, 100);
this.moveTo(_root.brushTip._x, _root.brushTip._y);
}
onClipEvent (enterFrame) {
_root.brushColor = '0x' + hex_color;
this.lineStyle(_root.brushSize, _root.brushColor, 100);
if (Key.isDown(32)) {
r = random(256);
g = random(256);
b = random(256);
decimal_color = r * 1000000 + g * 1000 + b;
hex_color = decimal_color.toString(16);
_root.brushColor = '0x' + hex_color;
trace(brushColor);
}
if (Key.isDown(81) && r < 255) {
++r;
hexR = r.toString(16);
hex_color = hexR + hexG + hexB;
}
if (Key.isDown(65) && r > 1) {
--r;
hexR = r.toString(16);
hex_color = hexR + hexG + hexB;
}
if (Key.isDown(87) && g < 255) {
++g;
hexG = g.toString(16);
hex_color = hexR + hexG + hexB;
}
if (Key.isDown(83) && g > 1) {
--g;
hexG = g.toString(16);
hex_color = hexR + hexG + hexB;
}
if (Key.isDown(69) && b < 255) {
++b;
hexB = b.toString(16);
hex_color = hexR + hexG + hexB;
}
if (Key.isDown(68) && b > 1) {
--b;
hexB = b.toString(16);
hex_color = hexR + hexG + hexB;
}
}
}