Salut
Alors j'ai un petit bug que je n'arrive pas a identifier dans le chargement d'un xml
Mon script fonctionne, mais uniquement pour la dernière valeur du xml. En somme il arrive a trouver quand le code du textefield = a un valeur du xml et m'associe le bon résultat... mais uniquement pour la derniere entrée du xml.
Si quelqu'un a une idée ca serait bien sympa
Merci a la communauté par avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 private function doReduction() { _root.panel9.IREDUC3.text = ""; _root.panel9.IREDUC2.text = ""; var xml_file = "http://www.xxxxxxx.com/_DbToXML/XMLdata_code.php"; var xmlData:XML = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad=function(){ var aNodes:Array = xmlData.firstChild.firstChild.childNodes; var nMaxNodes:Number = aNodes.length; var iterator = 0; for (var i:Number = 0; i < nMaxNodes; i++) { if (aNodes[iterator].attributes.code1 == _root.panel9.IREDUC.text){ _root.panel9.IREDUC3.text = "Code Valide"; _root.panel9.IREDUC2.text = aNodes[iterator].attributes.valeur; _root.aa="1"; } if (aNodes[iterator].attributes.code1 != _root.panel9.IREDUC.text){ _root.panel9.IREDUC3.text = "Code invalide"; _root.panel9.IREDUC2.text = ""; _root.aa="0"; } iterator++ } } xmlData.load(xml_file); }
Partager