Detecting nodes in xml as2

So i have this code so far \[code\]var my_xml = new XML();my_xml.ignoreWhite = true;my_xml.onLoad = onXMLLoaded;function reloadXML(){ my_xml.load("direktno.xml");}my_xml.load("direktno.xml");function onXMLLoaded() { if (my_xml.childNodes) { _root.main.ma4.minutegoal1.text = my_xml.firstChild } if (my_xml.childNodes[1]) { _root.main.navigator._visible = true;} else { _root.main.navigator._visible = false;}}\[/code\]Basically I'm, loading data from XML file in SWF file. Here is the XML: \[code\]<game><minute>67</minute><score1>1</score1><score2>3</score2></game><game><minute>67</minute><score1>1</score1><score2>3</score2></game>\[/code\]So now there are two childNodes \[code\]<game>\[/code\] As you can see I'm checking for \[code\](my_xml.childNodes[1])\[/code\] and in my case there is, so the \[code\]navigator\[/code\] is shown. But after it's been shown I have to make a button inside and when it's been pressed to load the content from second \[code\]childNode\[/code\] to \[code\]_root.main.ma4.minutegoal1.text\[/code\]
 
Back
Top