Combined Code
movieClip 2 enemy {
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.onLoad = function () {
x = 0;
r = random(256);
g = random(256);
b = random(256);
decimal_color = r * 10000 + g * 100 + b;
hex_color = decimal_color.toString(16);
brushColor = '0x' + hex_color;
this.lineStyle(brushSize, brushColor, 100);
this.moveTo(_root.enemy._x, _root.enemy._y);
};
this.onEnterFrame = function () {
brushSize = _root.enemy._height;
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);
brushColor = '0x' + hex_color;
}
if (Key.isDown(1)) {
++x;
this.lineStyle(brushSize, brushColor, 100);
this.lineTo(_root.enemy._x, _root.enemy._y);
}
if (Key.isDown(38)) {
_root.enemy._height += 5;
_root.enemy._width += 5;
}
if (Key.isDown(40) && brushSize > 1) {
_root.enemy._height -= 5;
_root.enemy._width -= 5;
}
};
}