Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2006, 07:13
starlancer
 
Fecha de Ingreso: diciembre-2001
Ubicación: Olavarria - Buenos Aires
Mensajes: 295
Antigüedad: 22 años, 3 meses
Puntos: 1
MovieClipLoader, problema curioso

Hola a todos:
Al menos para mi es un problema curioso, ya que generalmente cuando usamos MovieClipLoader debermos probarlo en el server porque en la simulacion de flash no funciona.
Pues a mi me sucede al reves, si me funciona en la simulacion de descarga, pero no en el server. ¿Alguien sabe porque?

Código:
var mi_mcl = new MovieClipLoader();
miListener = Object();
//Se inicia la carga
miListener.onLoadStart = function(target_mc) {
	target_mc._visible = false;
	target_mc._xscale = 100;
	target_mc._yscale = 100;
	//Barra de progreso
	_root.barra_mc._visible = true;
	_root.barra_mc.gotoAndStop(1);
};
//Durante la precarga
miListener.onLoadProgress = function(target_mc) {
	_root.porcentaje_txt._visible = true;
	var cargado = target_mc.getBytesLoaded();
	var total = target_mc.getBytesTotal();
	var porcentaje = Math.round(100*(cargado/total));
	_root.barra_mc.gotoAndStop(porcentaje);
	_root.porcentaje_txt.text = "Cargando..";
};
//Se termina la carga
miListener.onLoadComplete = function(target_mc) {
	_root.barra_mc._visible = false;
	//Aparece suavemente 
	alfa(target_mc);
	var porcentaje = 0;
};
//Se inicializa el clip para poder manipularlo
miListener.onLoadInit = function(target_mc) {
	target_mc._x = 20;
	target_mc._y = 20;
	target_mc._visible = true;
};
//En caso de errores
miListener.onLoadError = function(target_mc, errorCode) {
	trace("Error: "+errorCode);
};
mi_mcl.addListener(miListener);
stop();
La funcion "alfa()" solo hace aparecer un poco mas suave la pelicula cargada, si quieren probar el codigo pueden anular esa funcion, aunque creo que no trae inconvenientes.

Gracias
STARLANCER
__________________
"Caer esta permitido, levantarse es obligatorio"