Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/12/2006, 18:45
Avatar de roc2107
roc2107
ɹopɐɹǝpoɯ
 
Fecha de Ingreso: febrero-2003
Ubicación: León Guanajuato
Mensajes: 4.834
Antigüedad: 21 años, 1 mes
Puntos: 109
Re: Loader numerico

Pon este código en el primer fotograma:

MovieClip.prototype.preloader = function() {
var loading = "% Cargando..";
_root.createEmptyMovieClip("bar", -100);
//aqui dibujamos el color interior del preloader
_root.bar.lineStyle(.1, 0x808000, 0);
_root.bar.beginFill(0x808000, 100);
_root.bar.moveTo(0, 0);
_root.bar.lineTo(0, 2);
_root.bar.lineTo(100, 2);
_root.bar.lineTo(100, 0);
_root.bar.lineTo(0, 0);
_root.bar.endFill();
_root.bar._x = 200;
//270;
_root.bar._y = 75;
//300
_root.createEmptyMovieClip("ramme", 1);
//aqui dibujamos el marco alrededor del la barra
_root.ramme.lineStyle(1, 0x464600, 100);
_root.ramme.moveTo(0, 0);
_root.ramme.lineTo(0, 3);
_root.ramme.lineTo(104, 3);
_root.ramme.lineTo(104, 0);
_root.ramme.lineTo(0, 0);
_root.ramme._x = 200;
_root.ramme._y = 74;
//299
myFormat = new TextFormat();
//creamos el formato del texto
myFormat.font = "Arial";
myFormat.color = CD00A5;
myFormat.bold = false;
myFormat.size = 9;
_root.createEmptyMovieClip("tekst", 2);
//aqui creamos el texto que mostrara el porcentaje
_root.tekst.createTextField("fjeld", 50, 50, 50, 20, 20);
_root.tekst.fjeld.setNewTextFormat(myFormat);
_root.tekst.fjeld.autoSize = true;
_root.tekst._x = 255;
_root.tekst._y = 18;
_root.createEmptyMovieClip("control", 3);
//denne styrer hele proces
_root.control.onEnterFrame = function() {
//aqui escalamos es color interior y el texto
var b_total = getBytesTotal();
var b_loaded = getBytesLoaded();
if (b_loaded>=b_total) {
unloadMovie(_root.bar);
//se eliminan los mc cuando ya no son necesarios
unloadMovie(_root.ramme);
//se eliminan los mc cuando ya no son necesarios
unloadMovie(_root.tekst);
//se eliminan los mc cuando ya no son necesarios
_root.gotoAndPlay();
} else {
myPorcent = (b_loaded/b_total)*100;
_root.bar._xscale = myPorcent;
_root.tekst.fjeld.text = Math.floor(myPorcent)+loading;
}
//else
};
//onEnterFrame
};
//preloader
_root.preloader();
/******************** fin preloader *****************************************/
__________________
Blog de Diseño Gráfico roc21.com ||

El secreto de la creatividad es saber esconder tus fuentes.