Salut à tous.
Avec un ami nous essayons de comprendre la liaison flash xml...
J'ai trouvé un tuto assez simple mais j'aimerais supprimer certaines choses pour ne laisser que l'essentiel.
Dans le tuto il y a une fonction duplication (bien normale) que je voudrais supprimer pour faire vraiment un truc de base: un seul clip qui appelle une seule image avec une seule ligne dans le xml.
Je dois louper un truc car je n'y arrive pas.
voici le code:
tabimage = new Array();
XMLimage = new XML();
XMLimage.ignoreWhite = true;
XMLimage.onLoad = function(){
_root.cadre._visible = 0;
colonne = 5;
tabimage = XMLimage.firstChild.childNodes;
for(i=0; i<tabimage.length; i++){
_root.cadre.duplicateMovieClip("cadre"+i,i*1+5000);
_root["cadre"+i].glu.loadMovie(_root.tabimage[i].attributes.urlimage);
if(i<colonne){
_root["cadre"+i]._y = 70;
_root["cadre"+i]._x = 130*i+90;
}else{
_root["cadre"+i]._y = Number(_root["cadre"+(i-colonne)]._y)+130;
_root["cadre"+i]._x = _root["cadre"+(i-colonne)]._x;
}
}
}
XMLimage.load("album.xml");
stop();voici comment je l'ai déja simplifié:
tabimage = new Array();
XMLimage = new XML();
XMLimage.ignoreWhite = true;
XMLimage.onLoad = function() {
tabimage = XMLimage.firstChild.childNodes;
for (i=0; i<tabimage.length; i++) {
_root.cadre.duplicateMovieClip("cadre"+i, i*1+5000);
_root["cadre"+i].glu.loadMovie(_root.tabimage[i].attributes.urlimage);
}
};
XMLimage.load("album.xml");
stop();Maintenant je voudrais virer la boucle for mais si je mets:
tabimage = new Array();
XMLimage = new XML();
XMLimage.ignoreWhite = true;
XMLimage.onLoad = function() {
tabimage = XMLimage.firstChild.childNodes;
_root.cadre.glu.loadMovie(_root.tabimage.attributes.urlimage);
};
XMLimage.load("album.xml");
stop();ça marche plus......
Quelqu'un pourait-il m'indiquer où est l'erreur?