voila je commencais à me dire que tout se passait trop bien mais voilà, j'ai beau essayer de comprendre regarder sur les forums, comparrer avec des codes je ne vois pas le probleme alors si quelqu'un voulait bien etre mon sauveur car je commence à bloquer depuis un certain temps pour ne pas dire un temps certain...
le probleme est que les images ne se loadent pas je met egalement le texte du .xml.
ca doit pas etre bien compliqué mais là je vois pas
merci d'avance
le code sur l'image :
loader = new LoadVars();
loader.onLoad = function(success) {
if (success) {
_root.status = "OK !";
_root.test.html = true;
_root.test.htmlText = "<a href=\""+"http://nico.cricou.net"+"\">"+this.hello+"</a>";
} else {
_root.status = "ERREUR : Le fichier ne peut être chargé";
}
};
_root.status = "Veuillez patienter...";
loader.load(info);
stop();
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("cartes/amnord/"+pays+".xml");
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
// ///////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
le code du xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>usa.jpg</image>
<caption>image1</caption>
</pic>
<pic>
<image>alaska.jpg</image>
<caption>image2</caption>
</pic>
<pic>
<image>hawaii.jpg</image>
<caption>image3</caption>
</pic>
<pic>
<image>canada.jpg</image>
<caption>image4</caption>
</pic>
<pic>
<image>image_05.jpg</image>
<caption>image5</caption>
</pic>
<pic>
<image>image_06.jpg</image>
<caption>image6</caption>
</pic>
<pic>
<image>image_07.jpg</image>
<caption>image7</caption>
</pic>
<pic>
<image>image_08.jpg</image>
<caption>image8</caption>
</pic>
</images>