xmldata = 'galerie_fr.xml';
/////////////XML /////////////////////////////////////////////////////////////
var xml = new XML();
xml.ignoreWhite = true;
xml.load(xmldata);
xml.onLoad = function() {
var fichier:Array = new Array();
var theInfo:Array = new Array();
var images = xml.firstChild.childNodes;
for (id in images) {
theInfo[id] = images[id].attributes.info;
image = imgs.createEmptyMovieClip("image"+id, id);
}
var numOfPix:Number = images.length;
//////~~~ The text Format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var theFmt:TextFormat = new TextFormat();
theFmt.align = "left";
theFmt.color = 0xFF6600;
theFmt.font = "Kartika";//Franklin Gothic Book
theFmt.size = 15;
theFmt.bold = false;
//
_level0.txt.selectable = false;
_level0.txt.setNewTextFormat(theFmt);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (i=1; i<=numOfPix; i++) {
_level0.createTextField("theNum_txt", 1, 0, 0, w, h);
_level0.theNum_txt.text = i;
_level0.theNum_txt.setTextFormat(theFmt);
}
function pre_mvt() {
txt.text = theInfo[id];
}
next.onRelease = function() {
id++;
loading();
pre_mvt();
};
function loading() {
imgs.loadMovie("images/"+images[id].attributes.fichier);
_root.onEnterFrame = function() {
var totalBytes = imgs.getBytesTotal();
var loadedBytes = imgs.getBytesLoaded();
var percentDone = int((loadedBytes/totalBytes)*100);
if ((percentDone == 100) && (_root.haut.isTweening() == false) && (_root.flag == false)) {
bright();// ////////////////////////////////////////////////////////////////////////Action d'affichage de l'image
delete this.onEnterFrame;
_root.loading._visible = false;
}
};
}
};
Partager