
27/02/2007, 10:08
|
| | Fecha de Ingreso: septiembre-2006
Mensajes: 1.193
Antigüedad: 18 años, 4 meses Puntos: 30 | |
Re: SetTextFormat ? Cita:
Iniciado por hyperolimpics enmimente.com.ar/as/pg.zip
tenes razon olvidè poner el fla.
ahi lo copiè ok.
Bandit: no, el campo de texto
se crea desde cero por còdigo.
para los que no quieran bajarse
el fla, el codigo es el siguiente:
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.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! 
ok entonces intenta esto, corrige de ese codigo que tu pusiste que ya esta bien esto que esta marcado en azul:
Código:
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)+" %";
this.porcentaje.setTextFormat(fontformat);
}
// imagen cargada
if (this.cargador.percent == 100) {
alfa(this.cargador);
this.porcentaje.removeTextField();
delete this.onEnterFrame;
}
};
Última edición por Rizzo; 27/02/2007 a las 11:25 |