gusdark
Messages postés10Date d'inscriptionmercredi 19 mars 2003StatutMembreDernière intervention12 janvier 2010
-
12 janv. 2010 à 16:42
crackter
Messages postés401Date d'inscriptionmercredi 12 novembre 2003StatutMembreDernière intervention31 janvier 2010
-
13 janv. 2010 à 07:43
salut a tous !
voilà j'ai ce code là :
// Chargement XML et initialisation
photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(ok) {
//initialisation des variables
if (ok) {
noeuds = photos_xml.firstChild.childNodes;
// on se positionne au second niveau
nbrPhotos = noeuds.length;
// on récupère le nombre de noeuds à ce niveau
premierePhoto = this.firstChild.firstChild;
// on sélectionne le premier noeud
dernierePhoto = this.firstChild.lastChild;
// on sélectionne le dernier noeud
enCours = premierePhoto;
// enCours correspond au noeud en cours d'affichage
// ici, la premiere photo sera donc la premiere affichée
affichePhoto(enCours);
// on affiche la photo du premier noeud
}
};
photos_xml.load("photos.xml");
// affichage de la photo
function affichePhoto(photo) {
loadMovie(photo.attributes.fichier, ecran);
textes = photo.attributes.num + "/" + nbrPhotos + " : " + photo.attributes.desc;
}
// Gestion du bouton Suivant
suivant.onRelease = function() {
if (enCours.attributes.num == nbrPhotos) {
enCours = premierePhoto;
} else {
enCours = enCours.nextSibling;
}
affichePhoto(enCours);
};
// Gestion du bouton Précédent
precedent.onRelease = function() {
if (enCours.attributes.num == 1) {
enCours = dernierePhoto;
} else {
enCours = enCours.previousSibling;
}
affichePhoto(enCours);
};
je l'ai récupéré sur ce site, c'est une galerie photo.
et je voudrais avoir dans mon xml l'attribut lien et qu'on puisse cliquer sur la photo affichée pour aller sur le lien.