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
|
xmlGabari = new XML();
xmlGabari.load("xml/galerieFoto.xml");
xmlGabari.ignoreWhite = true;
xmlGabari.onLoad = function() {
var test = new Array();
var racineGalerie;
var ySSmenu = 30;
var titre;
var recupNbImage;
var cheminImage;
var racine = this.firstChild;
var recupNbGalerie = racine.childNodes.length;
//trace ("source du XML:"+racine.toString());
//trace ("nombre de galerie:"+recupNbGalerie);
for (var i = 0; i<recupNbGalerie; i++) {
racineGalerie = racine.childNodes[i];
titre = racineGalerie.childNodes[0].firstChild.nodeValue;
_root.attachMovie("etiquette",titre,i);
_root[titre].menuXml = titre;
styleT = new TextFormat();
styleT.color = 0x000000;
styleT.size = 14;
styleT.type = "dynamic";
styleT.font = "Courier New";
_root[titre].menuXml.setTextFormat(styleT);
_root[titre]._x = 650;
_root[titre]._y = ySSmenu;
ySSmenu += 30;
test[i] = titre;
rac[i] = racineGalerie;
}
for (var j = 0; j<test.length; j++) {
var tempo = test[j];
_root[tempo].btnCarre.onPress = function() {
trace(tempo);
cheminImage = racineGalerie.childNodes[1].firstChild.nodeValue;
recupNbImage = racineGalerie.childNodes[1].attributes["nbImage"];
var nbimg = 1;
_root.onMouseDown = function() {
if (this._xmouse>150 && this._xmouse<600 && this._ymouse>25 && this._ymouse<325) {
texteAccueil._y = -500;
creerCarte(nbimg);
nbimg++;
if (nbimg>=recupNbImage) {
nbimg = 1;
}
}
};
creerCarte = function (nbimg) {
_root.attachMovie("chargeurPhoto"+titre,titre+"chg",i);
_root[titre+"chg"] = new MovieClipLoader();
_root[titre+"chg"].loadClip("photos/"+cheminImage+nbimg+".jpg",cadrePhoto);
};
};
}
};
stop(); |
Partager