Foros del Web » Creando para Internet » Flash y Actionscript »

Random De Fotos

Estas en el tema de Random De Fotos en el foro de Flash y Actionscript en Foros del Web. HOLA, URGENTE!!! POR FAVOR NECESITO HACER UN RANDOM PARA UN MOVIECLIP DE FOTOS QUE TENGO, QUE AL CARGAR LA PELICULA CAIGA EN UNA FOTO DISTINTA ...
  #1 (permalink)  
Antiguo 07/11/2007, 12:01
 
Fecha de Ingreso: noviembre-2007
Mensajes: 64
Antigüedad: 16 años, 5 meses
Puntos: 5
Random De Fotos

HOLA, URGENTE!!!
POR FAVOR NECESITO HACER UN RANDOM PARA UN MOVIECLIP DE FOTOS QUE TENGO, QUE AL CARGAR LA PELICULA CAIGA EN UNA FOTO DISTINTA CADA VEZ. ALGUIEN PUEDE AYUDARME POR FAVOR??? GRACIAS
  #2 (permalink)  
Antiguo 08/11/2007, 10:23
Avatar de Bandit
Moderador
 
Fecha de Ingreso: julio-2003
Ubicación: Lima - Perú
Mensajes: 16.726
Antigüedad: 20 años, 9 meses
Puntos: 406
Re: Random De Fotos

Hola ritita:
Bienvenida al Foro.
En el primer frame de tu película coloca éste código:
var nombre_arr = new Array("nombre1.jpg", "nombre2.jpg");
MovieClip.prototype.load_random = function(img) {
this.loadMovie(img);
};
this.createEmptyMovieClip("contenedor", 1);
contenedor.load_random(nombre_arr[random(nombre_arr.length)]);
contenedor.onEnterFrame = function() {
if (this._currentframe == this._totalframes && this._totalframes>1) {
this.load_random(_root.nombre_arr[random(_root.nombre_arr.length)]);
}
};

Allí donde dice: nombre1.jpg coloca el nombre de las imágenes, puedes poner la cantidad de imágenes que necesites.

Espero haberte sido de ayuda.
__________________
Bandit.
Si no sabes estudia y si sabes enseña.
http://www.banditwebdesign.com/
  #3 (permalink)  
Antiguo 08/11/2007, 12:52
 
Fecha de Ingreso: noviembre-2007
Mensajes: 64
Antigüedad: 16 años, 5 meses
Puntos: 5
Re: Random De Fotos

Lo voy a probar. Muchas gracias por responder!!!! Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:05.