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
| images_xml = new XML();
images_xml.load("ici_xml/ici.xml");
images_xml.ignoreWhite = true;
images_xml.onLoad = initialisation;
function initialisation(success)
{
if (success == true)
{
raccourci = images_xml.firstChild;
totalImages = raccourci.childNodes.length;
premierNoeud = raccourci.firstChild;
dernierImage = raccourci.lastChild;
noeudEnCours = premierNoeud;
currentIndex =1;
actualiserImage(premierNoeud);
}
}
// ------ fonction d'affochage des images ---------- //
function actualiserImage(nouveauNoeud) {
cheminImage = nouveauNoeud.attributes.jpegURL;
cibleClip.loadMovie(cheminImage);
cibleClip._alpha+=5;
imageText = nouveauNoeud.firstChild.nodeValue;
}
// ----- code du bouton pour afficher l'image suivante -----//
bouton_suivant.onRelease = function() {
noeudSuivant = noeudEnCours.nextSibling;
if (noeudSuivant == null)
{
noeudEnCours = premierNoeud;
actualiserImage(premierNoeud);
currentIndex = 1;
} else {
noeudEnCours = noeudSuivant;
actualiserImage(noeudSuivant);
currentIndex++;
}
};
// ----- code du bouton pour afficher l'image précédente -----//
bouton_precedent.onRelease = function() {
noeudPrecedent = noeudEnCours.previousSibling;
if (noeudPrecedent == null)
{
noeudEnCours = dernierImage;
actualiserImage(dernierImage);
currentIndex = totalImages;
} else {
noeudEnCours = noeudPrecedent;
actualiserImage(noeudPrecedent);
currentIndex--;
}
}; |
Partager