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

precarga de movieclips

Estas en el tema de precarga de movieclips en el foro de Flash y Actionscript en Foros del Web. Buenas Tengo un problemilla... Necesito, una vez que se ha cargado la página principal con su swf, que se vallan cargando (sin aparecer en pantalla) ...
  #1 (permalink)  
Antiguo 14/11/2008, 13:09
 
Fecha de Ingreso: julio-2008
Mensajes: 83
Antigüedad: 15 años, 9 meses
Puntos: 0
precarga de movieclips

Buenas

Tengo un problemilla...

Necesito, una vez que se ha cargado la página principal con su swf, que se vallan cargando (sin aparecer en pantalla) los diferentes swf que voy cargando con LoadVar. Necesito que la cosa valla fluida al pulsar los botones.


Cómo se puede hacer esto?


Muchas Gracias
  #2 (permalink)  
Antiguo 14/11/2008, 20:30
ramonjosegn
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: precarga de movieclips

velapublicidad

hola,

no hay un sistema predefinido para ello,

yo he publicado un sistema propio, basado en los recursos de forosdelweb en otro post

y puedes usar precargas desde html con sólo meter los swf antes de lanzar la pelicula principal (aunque el otro día caí en la cuenta de que si tienen sonido se van a reproducir...)

en un sitio de codigos encontre estos:

************************************************** ********
Multiple Preloader with x movies loaded to levels
Simply put all your movies to load and the corresponding
levels in the array moviearray. Remember: If you don\'t
want the loaded clips to start immediatly after beeing
loaded, you have to place a stop action in the first
frame of the movie.

frame 1:
//provide a list with all your movies to load and the levels to load into
moviearray = new Array("movie1.swf",1,"movie2.swf",2,"movie3.swf",3 );
//set the index of the first movie to load
actMovieIdx = 0;

frame 2:
// get the next moviename and level
moviename = moviearray[actMovieIdx++];
movielevel = moviearray[actMovieIdx++];
// load the given movie
loadMovieNum(moviename, movielevel);

frame 3:
// nothing in here

frame 4:
//get the actual loaded bytes
actBytes = eval("_level" add movielevel).getBytesLoaded() || 0;
// get the total bytes to load
totBytes = eval("_level" add movielevel).getBytesTotal() || 100;
// calculate the percentage loaded
percent = Math.round(actBytes * 100 / totBytes);

if( totBytes - actBytes > 10){//more bytes available, keep on loading
gotoAndPlay(3);
} else if(actMovieIdx < moviearray.length){//if we got more movies to load
gotoAndPlay(2);
} // else go to frame 5

frame 5:
// ready, go - here starts your movie
***********************************************
***********************************************
Multiple Preloader with x movies loaded to targets
Simply put all your movies to load and the corresponding
targets in the array moviearray. Remember: If you don\'t
want the loaded clips to start immediatly after beeing
loaded, you have to place a stop action in the first
frame of the movie.

frame 1:
//provide a list with all your movies to load and the targets to load into
moviearray = new Array("movie1.swf","target1","movie2.swf","target2 ","movie3.swf","target3");
//set the index of the first movie to load
actMovieIdx = 0;

frame 2:
// get the next moviename and level
moviename = moviearray[actMovieIdx++];
movietarget = moviearray[actMovieIdx++];
// load the given movie
loadMovie(moviename, movietarget);

frame 3:
// nothing in here

frame 4:
//get the actual loaded bytes
actBytes = eval(movietarget).getBytesLoaded() || 0;
// get the total bytes to load
totBytes = eval(movietarget).getBytesTotal() || 100;
// calculate the percentage loaded
percent = Math.round(actBytes * 100 / totBytes);

if( totBytes - actBytes > 10){//more bytes available, keep on loading
gotoAndPlay(3);
} else if(actMovieIdx < moviearray.length){//if we got more movies to load
gotoAndPlay(2);
} // else go to frame 5

frame 5:
// ready, go - here starts your movie

*******************************************
*******************************************
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 09:07.