hi i im from venezuela so my english is no so good sorry for that but i have a problem with the for loop
so heres the problem have a fly movieclip thats lincked as fly and i need 20 of them that move ramdomly i have that part done but I dont know how to make the 20 fly move beacuse is with an enterframe event and i need that wen i click it it disapears(i know how to make that so heres the code so far for one fly:
mosca.stop();
aplastado = false;
acceleration = 10;
for (i = 0; i < 20; i++) {
mc = attachMovie(“mosca”, “mosca” + i, 100 + i);
mc.stop();
mc._x = Math.random() * Stage.width;
mc._y = Math.random() * Stage.height;
newpos();
}
newpos = function () {
ranx = Math.round((Math.random() * Stage.width));
rany = Math.round((Math.random() * Stage.height));
};
newpos();
mosca.onEnterFrame = function() {
if (!aplastado) {
this._x += ((ranx - this._x) / acceleration);
this._y += ((rany - this._y) / acceleration);
if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
newpos();
}
}
if (aplastado) {
this._alpha -= 5;
}
if (this._alpha == 0) {
removeMovieClip(this);
}
};
mosca.onRelease = function() {
this.gotoAndStop(“aplastado”);
aplastado = true;
i–;
};
i will apreciate a lot the help tnx