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

please..urgente! galeria flash carga aleatoria

Estas en el tema de please..urgente! galeria flash carga aleatoria en el foro de Flash y Actionscript en Foros del Web. tengo este codigo de un template q baje, pero quiero hacer que tenga la carga de las imagenes aleatoria.. donde y como lo modifico? stop(); ...
  #1 (permalink)  
Antiguo 16/09/2010, 09:55
 
Fecha de Ingreso: junio-2006
Mensajes: 1
Antigüedad: 17 años, 10 meses
Puntos: 0
Pregunta please..urgente! galeria flash carga aleatoria

tengo este codigo de un template q baje, pero quiero hacer que tenga la carga de las imagenes aleatoria.. donde y como lo modifico?

stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;

tn_mc._visible = false;
var intervalId:Number;
var initial_alpha:Number = 20;
var i:Number = 1;
var j:Number = 0;
var k:Number = 0;
var duration:Number = 250;

var maxCount:Number = 22;

var label_list:Array = new Array("000_design", "000_design","000_design","001_design","002_design ","003_design","004_design","005_design","006_desi gn","007_design","008_design","009_design","010_de sign","011_design","012_design","013_design","014_ design","015_design","016_design","017_design","01 8_design","019_design","020_design");

var link_list:Array = new Array("http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.","http://www.");


function createThumbnails()
{
duplicateMovieClip( tn_mc, "tn" + i, i );
this["tn" + i].gotoAndStop(i);

position_x = j * 110 + 240;
position_y = k;
j++;
if( i % 5 == 0 ) { j = 0; k++; }

this["tn" + i]._x = position_x;
this["tn" + i]._alpha = initial_alpha;
this["tn" + i].fm_label.text = label_list[i-1];
this["tn" + i].fm_url = link_list[i-1];
this["tn" + i].fm_button._visible = false;
random_y = random(450);

new Tween(this["tn" + i], "_alpha", Strong.easeInOut, initial_alpha, 100, 3, true);
new Tween(this["tn" + i], "_x", Strong.easeOut, position_x + 300 - i*10, position_x - i*10, 3, true);
new Tween(this["tn" + i], "_y", Elastic.easeInOut, position_y + 200 + i*20, position_y + i*20, 3, true);

this["tn" + i].fm_button.onPress = function()
{
this._parent.swapDepths(_root.getNextHighestDepth( ));
this._parent.startDrag();
}
this["tn" + i].fm_button.onRelease = function()
{
this._parent.stopDrag();
}
this["tn" + i].fm_link.onRelease = function()
{
getURL( this._parent.fm_url );
}
if(i >= maxCount)
{
clearInterval(intervalId);
for( i = 1; i <= maxCount; i++ )
this["tn" + i].fm_button._visible = true;
}
i++;
}
intervalId = setInterval(this, "createThumbnails", duration);
  #2 (permalink)  
Antiguo 16/09/2010, 23:44
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 8 meses
Puntos: 214
Respuesta: please..urgente! galeria flash carga aleatoria

aquí carga los valores de los arrays

Código actionscript:
Ver original
  1. this["tn" + i].fm_label.text = label_list[i-1];
  2. this["tn" + i].fm_url = link_list[i-1];

y pues i empieza en 0, y con eso al parecer
válidan otras cosas, así que yo haría uso de
otra variable parecida a random_y, que también
en cada ciclo genere un aleatorio, pero que vaya desde 0 hasta el length del array,
y luego el valor de esta variable sea el que se use

Código actionscript:
Ver original
  1. this["tn" + i].fm_label.text = label_list[nueva_variable];
  2. this["tn" + i].fm_url = link_list[nueva_variable];

espero te sirva la idea
saludos
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com

Etiquetas: aleatoria, carga, flash, galeria
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 19:39.