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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
//creation MCs
this.createEmptyMovieClip("index", this.getNextHighestDepth());
var trucacharger:Array = new Array("./pics/ConcertsBG2-3.jpg","./pics/header_suite2.jpg");
var infosArray:Array = new Array("Chargement : Version Lite");
var numero:Number=0;
var nextnum:Number=0;
//Creation Listener :
var mclListener:Object = new Object();
mclListener.onLoadInit = function(clip:MovieClip) {
};
mclListener.onLoadStart = function(clip:MovieClip)
{
nextnum=numero+1;
preloader.infos.text=infosArray[numero];
preloader.fichiers.text="Fichier : " + nextnum +"/1";
preloader._visible = true;
preloader.loadBarFull._xscale=0;
};
mclListener.onLoadProgress = function(clip, w, t) {
var w = clip.getBytesLoaded();
var t = clip.getBytesTotal();
preloader.loadBarFull._xscale =Math.round(w*338.1/t);
preloader.percent.text = Math.round(w/t*100) + " %";
};
mclListener.onLoadComplete = function(clip:MovieClip) {
preloader.percent.text = "";
numero++;
loadNext();
};
mclListener.onLoadError = function(clip:MovieClip, errorCode:String) {
preloader.percent.text = "Error loading basic files";
};
//Creations MCLoaders :
var myLoader:MovieClipLoader = new MovieClipLoader();
myLoader.addListener(mclListener);
myLoader.loadClip("./pics/ConcertsBG2-3.jpg",index);
var loadNext:Function = function(Void):Void
{
if (numero < trucacharger.length)
{
switch(numero)
{
case(0):break;
case(1):
myLoader.loadClip(trucacharger[numero],mvt2_mc);
break;
case(2):
myLoader.loadClip(trucacharger[numero],mvt4_mc);
break;
case(3):
myLoader.loadClip(trucacharger[numero],mvt6_mc);
break;
case(4):
myLoader.loadClip(trucacharger[numero],mvt8_mc);
break;
}
}
else
{
//tout est chargé :
this.nextFrame();
}
}
this.stop(); |
Partager