Return to Snippet

Revision: 1537
at October 18, 2006 07:09 by danideu


Initial Code
stop();
//Alexis Garrido
//Web Developer
onEnterFrame = function () {
var r = Math.round((getBytesLoaded()/getBytesTotal())*100);
cor_y = Stage.height/2;
cor_x = Stage.width/2;
this.createTextField("carga", 102, cor_x-41, cor_y-2.6, 100, 20);
this.createEmptyMovieClip("barra", 100);
barra.beginFill(0xFFFFFF);
barra.moveTo(0, 0);
barra.lineTo(200, 0);
barra.lineTo(200, 10);
barra.lineTo(0, 10);
barra.lineTo(0, 0);
barra.endFill();
this.createEmptyMovieClip("des", 101);
des.beginFill(0xCCCCCC);
des.moveTo(0, 0);
des.lineTo(200, 0);
des.lineTo(200, 10);
des.lineTo(0, 10);
des.lineTo(0, 0);
des.endFill();
des._x = cor_x-105;
des._y = cor_y;
des._xscale = r;
barra._x = cor_x-105;
barra._y = cor_y;
barra._xscale = 100;
var formato:TextFormat = new TextFormat();
formato.color = 0x000000;
formato.bold = true;
formato.size = 10;
formato.font = "Arial";
carga.text = "Cargando "+r+"%";
carga.setTextFormat(formato);
if (r == 100) {
delete onEnterFrame;
carga._visible = 0;
barra._visible = 0;
des._visible = 0;
play();
}
};

Initial URL


Initial Description
Aligerar el tiempo en crear mis precargas ... lo bueno de esto es que se adapta al tamaño del escenario del flash .. y todo es dinamico

Initial Title
Precargador dinamico adaptable

Initial Tags
actionscript, flash

Initial Language
ActionScript