Check my little piece of code. Everything’s going well, until the onEnterFrame. My MC instances aren’t doin’ anything!
Can anybody tell me what I’m doin’ wrong?
colors = [0x66FF00, 0x20DFD0, 0xEE1164, 0xDAE31C];
MovieClip.prototype.drawCube = function(_moveY, _amount) {
for (i=0; i<_amount; i++) {
this.createEmptyMovieClip("cube"+i, i);
this["cube"+i].lineStyle(1, colors[random(4)], 50);
this["cube"+i].beginFill(0x2a0000, 80);
this["cube"+i].moveTo(0, 0);
this["cube"+i].lineTo(5, 0);
this["cube"+i].lineTo(5, 5);
this["cube"+i].lineTo(0, 5);
this["cube"+i].endFill();
this["cube"+i]._x = random(Stage.width);
this["cube"+i]._y = Stage.height-7;
this.onEnterFrame = function() {
this["cube"+i]._y -= _moveY;
};
}
};
drawCube((random(7)+3), 10);
Thanks in advance!