Ciao a tutti vorrei convertire lo script seguente da Actionscript 1 a Actionscript 2 (se lo lascio così non mi funziona pubblicandolo come AS2 e ne ho necessità!):
Il codice crea arte astratta casuale...codice:function creasfondo() { function tipoRiempimento() { n = Math.random(); if (n<0.5) { Rie = "radial"; } else { Rie = "linear"; } //trace("tipo riempimento = "+Rie); } function colori() { n = Math.round(Math.random()*5)+1; col = new Array(n); for (i=0; i<n; i++) { rosso = Math.round(Math.random()*255); verde = Math.round(Math.random()*255); blu = Math.round(Math.random()*255); colore = (rosso << 16 | verde << 8 | blu); col[i] = "0x"+colore.toString(16); //trace("colori "+i+" = "+col[i]); } } function alfa() { alf = new Array(n); for (i=0; i<n; i++) { alf[i] = Math.round(Math.random()*100); //trace("alfa "+i+" = "+alf[i]); } } function rapporti() { rapp = new Array(n); for (i=0; i<n; i++) { rapp[i] = Math.round(Math.random()*255); //trace("rapporti "+i+" = "+rapp[i]); } } function matrice() { mat = { a:Math.round(Math.random() * 255), b:Math.round(Math.random() * 255), c:Math.round(Math.random() * 255), d:Math.round(Math.random() * 255), e:Math.round(Math.random() * 255), f:Math.round(Math.random() * 255), g:Math.round(Math.random() * 255), h:Math.round(Math.random() * 255), i:Math.round(Math.random() * 255) }; //trace("matrice "+i+" = "+mat); } tipoRiempimento(); colori(); alfa(); rapporti(); matrice(); _root.createEmptyMovieClip("sfondo", 0); with (_root.sfondo) { beginGradientFill(Rie, col, alf, rapp, mat); lineStyle(1, 0x000000); moveto(0, 0); lineto(0, 180); lineto(230, 180); lineto(230, 0); lineto(0, 0); endFill(); } } creasfondo();
Qualcuno può aiutarmi?
![]()

Rispondi quotando
