salve a tutti: vi espongo il problema
io vorrei caricare in maniera random delle piume su di un filmato, in modo che queste piume caschino, sempre in maniera random
praticamente voglio fare una decina di filmati simboli, e che vengano caricati in maniera random.
fino ad ora sono riuscito solo a farne caricare uno per bene
vi posto lo script
quantePiume = 9;
discesa = 2;
velocita = 2;
caricaPiuma = function () {
for (var i = 0; i<quantePiume; i++) {
x = 600;
y = -400;
m = 50;
Xinit = (Math.random()*x);
Yinit = (Math.random()*y);
moltiplicatore = (Math.random()*m);
ics = (Xinit+(i*moltiplicatore));
ipsilon = (Yinit+(i*moltiplicatore));
attachMovie("piuma", "piuma"+i, i, {_x:ics, _y:ipsilon});
this["piuma"+i].onEnterFrame = function() {
inizioX = -450;
initics = Math.random()*inizioX;
this._x += velocita;
this._y += discesa;
if (this._x>650) {
this._x = -50;
}
if (this._y>450) {
this._y = initics;
}
};
}
};
caricaPiuma();

Rispondi quotando