.netart - numero 5, ottobre 2000 - anno 2
.netart - la rivista italiana di webdesign
 
 home page
 premio .netart
 entry level
 mailing list
 archivio
 
 
 email
 credits

Licence to Flash: Fuochi d'artificio


Scarica il file .fla (zippato)

Attenzione, questo script funziona solo con il Flash Player versione 5. Se non vedete nulla significa che e' il momento giusto per fare un bell'upgrade. Dove? Qua.
Warning, this tutorial only works if you have Flash Player version 5 intalled on your system. If you don't see anything it means that this is the right moment for a software upgrade. Where? Here.

The Action Script:


onClipEvent (load) {  
  startDrag (this, true);
  index=0;
}
onClipEvent (mouseDown) {
  for (ii=1; ii<=100; ii++) {
    index++;
    _root.fw.duplicateMovieClip("fw"+index, index);
    myFw = eval("_root.fw"+index);
    myFw._x = this._x;
    myFw._y = this._y;
    myFw._rotation = random(360);
    myFw._xscale = random(50)+50;
    myFw._yscale = random(50)+50;
  }
}

Alcune spiegazioni:
Tramite l'onClipEvent(load) settiamo la variabile index, che ci permettera' di mantenere un controllo sulla quantita' di cicli del loop for successivo. Sempre al caricamento del movie clip, quindi, faremo in modo che questo diventi trascinabile, tramite la funzione startDrag (this, true);.

Al click di ogni mouse (onClipEvent(mouseDown)) faremo duplicare il movie clip con ogni singola scintilla del fuoco d'artificio, e modificheremo la sua rotazione e dimensione in modo casuale (random(...)).

Some explanations:
Trough the onClipEvent(load) we set the variable index, which will enable us to retain a control over the quantity of the cycles in the for loop, afterwards. So, at the load of the movie clip we make the it draggable, using startDrag (this, true);.

At every mouse click (onClipEvent(mouseDown)) we will duplicate the Movie with every single bit of the firework, and we will modify its rotation and dimension with a random value (random(...)).



-- JayJam



^ torna su

 ENGLISH
[1] Editorial. No, we're not dead nor about to die. Let us explain...

[2] Peter Van Den Wyngaert, nrg.be. One of the best Flash3 developers shares his fears and expectation about the 5th generation of this tool

[3] Licence to Flash. Jay Jam and the fireworks!

 
http://netart.stradanove.net/
© 2000 Antonio Cavedoni, Frederic Argazzi e Adriano Fragano.