[FLASH MX2004] Eval()et XML
Bonjour à tous,
J'ai le code suivant :
Code:
1 2 3 4
| plop = "nextSibling."; // contenu variable
toto = "imgXml.firstChild.firstChild."+plop+"childNodes["+i+"].attributes.image";
chemin = eval(toto);
trace(chemin); |
Malheureuseusement au lieu de me renvoyer :
img\souris\s1.jpg
img\souris\s2.jpgz
...
Je récupère simplement un "Undefined". C'est surtout le "childNodes[i]" qui semble bloquer mon code.
Ai-je une erreur de syntaxe ? Suis-je limité par le Eval() ?
Je n'arrive pas à trouver de solution...
Merci d'avance.
Re: [FLASH MX2004] Eval()et XML
Actionscript ne marche pas comme ça.
Code:
1 2 3
| plop = "nextSibling";
toto = imgXml.firstChild.firstChild[plop].childNodes[i].attributes.image;
trace(toto); |
a plus de chances de marcher, si tant est que i est défini.