Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/02/2007, 13:54
hyperolimpics
 
Fecha de Ingreso: septiembre-2006
Mensajes: 76
Antigüedad: 17 años, 6 meses
Puntos: 1
Re: SetTextFormat ?

mhm. con eso me topè cuando investiguè para
resolverlo... pero nada, sigue apareciendo igual.
segun lo que me decis, el codigo quedaria asi...
¿està bien?



Código:
//función FX fadeIn 
alfa = function (clip) {
	this.createEmptyMovieClip("loop", 3);
	loop.onEnterFrame = function() {
		clip._alpha += 10;
		if (clip._alpha>=100) {
			delete loop.onEnterFrame;
		}
	};
};
// crear un clip vacio para cargar la imagen
this.createEmptyMovieClip("cargador",1);
// crear un campo de texto para mostrar el porcentaje cargado de la imagen
this.createTextField("porcentaje",2,10,10,200,16);
this.fontformat = new TextFormat();
this.fontformat.font = "Arial";
this.fontformat.size = 20;
this.fontformat.color = 0x666666;
this.fontformat.bold = true;
// Asignando formato
this.porcentaje.setTextFormat(fontformat);
this.porcentaje._x = 200;
this.porcentaje._y = 150;
this.cargador._x = 25;
this.cargador._y = 31;
this.ancho = 350;
this.alto = 263;
// cargar la imagen
this.cargador.loadMovie("img/imagen01.jpg");
//this.cargador.loadMovie("img/imagen.jpg?id="+random(1000));
this.cargador._alpha = 0;
// precarga
this.onEnterFrame = function() {
	this.cargador.percent = (this.cargador.getBytesLoaded()/this.cargador.getBytesTotal())*100;
	if (this.cargador.percent) {
		this.porcentaje.text = Math.round(this.cargador.percent)+" %";
	}
	// imagen cargada	
	if (this.cargador.percent == 100) {
		alfa(this.cargador);
		this.porcentaje.removeTextField();
		delete this.onEnterFrame;
	}
};


gracias!.