Comunidad de diseño web y desarrollo en internet online

Cargar random swf

Citar            
MensajeEscrito el 01 Sep 2008 11:09 pm
Hola como puedo cargar un swf random o aleatorio gracias ?

Por nikolo

5 de clabLevel



 

msie
Citar            
MensajeEscrito el 02 Sep 2008 10:02 am
Si tienes "peli1.swf", "peli2.swf", .... , "peli5.swf" haces

loadMovie("peli"+((Math.random()*5)+1)+".swf")

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 02 Sep 2008 10:03 am
Si tus SWF se llaman peli0.swf, peli1.swf, peli2.swf, etc... creas un random y lo lees:

Código ActionScript :

var cantidad:Number = 5; //---Esta es la cantidad de SWF

var rand:Number = Math.floor(Math.random() * cantidad);

trace("Puedes mandar a cargar el movie peli" + rand + ".swf");

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

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