Bonjour , mon probleme et le suivant lors de la réalisation d'une gallerie avec importation des photo por fichier xml je voudrai mettre un fade sur les photos. Lorsque j'appuie sur mon bouton precedent ou suivant la premier photo s'efface et la deuxieme apparait. Je suis encore debutant.voici mon code action present dans mon fichie flash:
System.useCodepage = true ;
photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(ok) {
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) {
if (photo.attributes.num == 1) {
prec = dernierePhoto;
} else {
prec = photo.previousSibling;
}
loadMovie(photo.attributes.fichier, ecran);
textes = photo.attributes.num + "/" + nbrPhotos + " : " + photo.attributes.desc;
ecran._xscale= 150;
ecran._yscale= 115;
}
suivant.onRelease = function() {
if (enCours.attributes.num == nbrPhotos) {
enCours = premierePhoto;
} else {
enCours = enCours.nextSibling;
}
affichePhoto(enCours);
};
precedent.onRelease = function() {
if (enCours.attributes.num == 1) {
enCours = dernierePhoto;
} else {
enCours = enCours.previousSibling;
}
affichePhoto(enCours);
};
le code que j'ai touver pour le fade mais je ne sais pas comment l'inserer et je sais pas si c le bon pour mon probleme. lorque je l'inser il me fais clignoter les photos:
var fade;
function setalpha(action) {
if (action) {
_root.dmc._alpha -= 2;
if (_root.dmc._alpha<=0) {
clearInterval(fade);
fade = setInterval(setalpha, 100, false);
}
} else {
_root.dmc._alpha += 2;
if (_root.dmc._alpha>=100) {
clearInterval(fade);
fade = setInterval(setalpha, 100, true);
}
}
}
fade = setInterval(setalpha, 100, true);
stop();
Je ne sais pas si quelqu'un pourrait m'aider mais J'aimerai bien merci a vous d'avance
si meilleur solution n'hesiter pas a me proposer .