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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
sw = 900;
SLIDE_LoadFinished = function () {
delete conteneur.onEnterFrame;
trace("LOAD FINISHED");
conteneur.onEnterFrame = function () {
for (z in imgLoaded) {
mc = imgLoaded[z];
nx = mc._x - step;
if (nx< -mc._width) mc._x = conteneur._width - mc._width - 2
else mc._x = nx
}
}
}
SLIDE_LoadImg = function () {
row = imgPreload.pop();
if (row!=undefined) {
var mc = conteneur.attachMovie("TN", "img_"+deep, deep);
mc.loadMovie(row);
mc._x = w;
imgLoaded.push(mc);
conteneur.refer = mc;
conteneur.onEnterFrame = function () {
var pct = this.refer.getBytesLoaded() * 100 / this.refer.getBytesTotal();
if (pct>=99 && this.refer.getBytesLoaded()>1000 ) {
w += this.refer._width;
SLIDE_LoadImg();
}
}
deep++;
} else SLIDE_LoadFinished()
}
SLIDE_TnInit = function () {
FEED ("Initialisation...");
deep = 666;
w = 0
tnFolder = pdts.firstChild.attributes.tnFolder;
step = pdts.firstChild.attributes.step;
imgPreload = [];
imgLoaded = [];
//
for (z=0; z<pdts.firstChild.childNodes.length; z++) {
imgPreload.push (tnFolder+pdts.firstChild.childNodes[z].attributes.tn)
}
//
SLIDE_LoadImg ();
//
FEED ("");
}
SLIDE_Init = function () {
if (xmlPath==undefined) FEED ("Le fichier xml n'est pas spécifié.")
else {
FEED ("Chargement des données...")
pdts = new XML();
pdts.ignoreWhite=true;
pdts.load (xmlPath);
pdts.onLoad = function () {
if (this.status==0) SLIDE_TnInit ()
else FEED ("Le fichier xml est mal formaté.<BR>Code erreur : " + XML_Status(this.status) )
}
}
}
/*****************************************************************************************************/
XML_Status = function(code) {
switch (Number(code)) {
case 0: return "XML correct.";
case -2: return "(-2) CDATA section not correctly closed";
case -3: return "(-3) XML declaration not correctly closed";
case -4: return "(-4) DOCTYPE declaration not correctly closed";
case -5: return "(-5) Comment not correctly closed";
case -6: return "(-6) XML element not correctly closed";
case -7: return "(-7) Not enough memory";
case -8: return "(-8) Attribute not correctly closed";
case -9: return "(-9) End tag not correctly closed";
case -10: return "(-10) End tag has no begin tag.";
}
}
FEED = function (msg) {
feed_text.htmlText = msg;
feed_text.autoSize=true;
feed_text._visible=true;
} |
Partager