Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/10/2012, 23:53
Avatar de efragil
efragil
 
Fecha de Ingreso: julio-2012
Ubicación: España
Mensajes: 7
Antigüedad: 11 años, 9 meses
Puntos: 0
precarga para swf con jpg cargados aleatoriamente

Os saludo de nuevo.
Vuelvo a necesitar ayuda y espero concluir con este trabajo.

El swf principal cada vez que se ejecuta lo hace con una imagen de fondo diferente. Las carga aleatoriamente. El problema es que la precarga que utilizo para cada uno de los swf de la web no funciona para el swf principal. Dejo el código de la carga aleatoria por si facilita algo.

Agradezco muchísimo vuestra ayuda. Un abrazo.

Stage.scaleMode = "noScale";
Stage.align = "TL";

var miArray:Array = new Array();
miArray[0] = "1";
miArray[1] = "2";
miArray[2] = "3";
miArray[3] = "4";
miArray[4] = "5";
miArray[5] = "6";
valor = random(6);
pelicula = miArray[valor];
fondo.attachMovie(pelicula, "fondo"+pelicula, getNextHighestDepth());

myListener = new Object();
// asociamos el objeto al stage para detectar los cambios
// de tamaño del stage
Stage.addListener(myListener);
// ejecuto la función rec al cambiar el tamaño
myListener.onResize = rec;
function rec():Void {
//---Tamaño del fondo
var maxWidth:Number = Stage.width;
var maxHeight:Number = Stage.height;
fondo._width = maxWidth;
fondo._height = maxHeight;
fondo._yscale = fondo._xscale;
mc_menu._x = (Stage.width-mc_menu._width)/2;
if (fondo._height<maxHeight) {
fondo._height = maxHeight;
fondo._xscale = fondo._yscale;
}
//---Posición del fondo
fondo._x = (Stage.width-fondo._width)/2;
fondo._y = (Stage.height-fondo._height)/2;
mc_menu._x = (Stage.width-mc_menu._width)/2;
}
rec();
stop();