1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| function chargementAnimation () {
/* creation de la barre de chargement de l'animation */
this.createEmptyMovieClip("mc_chargement", 9999);
var bar1:MovieClip = mc_chargement.createEmptyMovieClip("mc_barreFond", 10);
bar1.beginFill(0xD1D0CF);
bar1.moveTo(0, 0);
bar1.lineTo(600, 0);
bar1.lineTo(600, 10);
bar1.lineTo(0, 10);
bar1.lineTo(0, 0);
bar1.endFill();
var bar2:MovieClip = mc_chargement.createEmptyMovieClip("mc_barreCharge", 20);
bar2.beginFill(0x7D7C79);
bar2.moveTo(0, 0);
bar2.lineTo(600, 0);
bar2.lineTo(600, 10);
bar2.lineTo(0, 10);
bar2.lineTo(0, 0);
bar2.endFill();
bar2._xscale = 0;
mc_chargement.createTextField("text_chargement", 30, 0, 0, 100, 22);
mc_chargement.text_chargement._y = 10;
mc_chargement.text_chargement.html = true;
mc_chargement.text_chargement.autoSize = true;
mc_chargement.text_chargement.textColor = 0x666666;
mc_chargement.text_chargement.selectable = false;
mc_chargement._x = 212;
mc_chargement._y = 290;
/////////////////////////////////////////////////
this.onEnterFrame = function() {
var pctLoaded:Number = Math.round(this.getBytesLoaded()/this.getBytesTotal()*100);
mc_chargement.mc_barreCharge._xscale = pctLoaded;
mc_chargement.text_chargement.text = "Chargement de l'animation, veuillez patienter." + " ( " + pctLoaded + " % chargés ).";
mc_chargement.text_chargement.htmlText = "Chargement : <b>"+ pctLoaded +" %</b> effectué";
if (pctLoaded == 100) {
removeMovieClip(mc_chargement);
delete onEnterFrame;
delete chargementAnimation;
this.nextFrame();
}
}
}
chargementAnimation();
stop(); |