salut tout le monde,
je galere a faire afficher une le liste de photo avec leur info tirés d'1 xml
g recupéré un script qui me permet d'afficher une par une et de faire next et previous
mais je veux les afficher par rapport a une taille prédefinie et s'il y'en beaucoup je pourrai les scroller
je cherche a faire qlqchose du genre sur
www.mcm.net, leur rubrique gagne avec mcm ou news
mon scipt actuel :
// 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;
nbrPhotos = noeuds.length;
premierePhoto = this.firstChild.firstChild;
dernierePhoto = this.firstChild.lastChild;
enCours = premierePhoto;
affichePhoto(enCours);
}
};
photos_xml.load("photos.xml");
function affichePhoto(photo) {
//g essayé de faire une boucle mais ça passe pas !
//for (var enCours = 0; enCours < nbrPhotos; enCours++) {
loadMovie(photo.attributes.fichier, ecran);
titres = photo.attributes.num + "/" + nbrPhotos + " : " + photo.attributes.desc;
resume = photo.childNodes[0].childNodes[0];
liens = photo.childNodes[1].childNodes[0];
//enCours = enCours.nextSibling;
//}
}
// 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);
};
please help
thanks d'avance