Comunidad de diseño web y desarrollo en internet online

codigo en as2

Citar            
MensajeEscrito el 23 Feb 2009 03:35 am
hola por favor me pueden ayudar para pasar este codigo a AS3

Código :

for (i=5; i<100; i++) {
   duplicateMovieClip("destello", "destello"+i, i);
   anim = this["destello"+i];
   anim._rotation = random(360);
   anim._alpha = random(30)+80;
   anim._xscale = random(60)+50;
   anim._yscale = random(60)+50;
}

Por julioli

21 de clabLevel



 

msie7
Citar            
MensajeEscrito el 23 Feb 2009 10:24 am
Asi como esta, ya anda para AS3. :cool:

Por Stranyer

38 de clabLevel



 

unknown
Citar            
MensajeEscrito el 23 Feb 2009 12:41 pm
no, no "anda".

Deberia ser algo asi:

Código ActionScript :

for (var i=5; i<100; i++) {
   var anim = new destello()
   anim.rotation =  Math.random() * 360;
   anim.alpha = Math.random() * .3 + .8
   anim.scaleX = Math.random() * .6 + .5
   anim.scaleY = Math.random() * .6 + .5
   addChild(anim);
}

Por esedeerre

132 de clabLevel



 

MadRid

opera
Citar            
MensajeEscrito el 23 Feb 2009 05:57 pm
porfavor podrias explicar como es esta linea

Código :

var anim = new destello() 

Por julioli

21 de clabLevel



 

msie7
Citar            
MensajeEscrito el 23 Feb 2009 06:06 pm
Pues el clip que llamas "destello", lo tienes que tener vinculado en la biblioteca a la clase "destello".

Botón derecho en el clip, seleccionas vinculación, y en clase pones "destello".

Por esedeerre

132 de clabLevel



 

MadRid

opera
Citar            
MensajeEscrito el 23 Feb 2009 06:35 pm
si ya me funciono pero hay algo mas que no entiendo
por que en esta parte

Código :

anim.alpha = Math.random() * .3 + .8   
anim.scaleX = Math.random() * .6 + .5   
anim.scaleY = Math.random() * .6 + .5 

pones ".3" ".8" ".6" ".5"

ah y tambien podrias explicar un como funciona el new destello() :oops:

Por julioli

21 de clabLevel



 

msie7
Citar            
MensajeEscrito el 23 Feb 2009 06:44 pm
ya entendi el porque esos numeros

es porque toma el 100% como 1 :)

Por julioli

21 de clabLevel



 

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.