# XML simple parser, don´t know how to do this - very basic -

**URL:** https://forum.kirupa.com/t/xml-simple-parser-don-t-know-how-to-do-this-very-basic/111814
**Category:** Uncategorized
**Created:** [May 31, 2004, 6:48pm UTC](https://forum.kirupa.com/t/xml-simple-parser-don-t-know-how-to-do-this-very-basic/111814 "2004-05-31T18:48:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mentalgeek](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@mentalgeek](https://forum.kirupa.com/u/mentalgeek)
#### Post date: [May 31, 2004, 6:48pm UTC](https://forum.kirupa.com/t/xml-simple-parser-don-t-know-how-to-do-this-very-basic/111814/1 "2004-05-31T18:48:23Z")

</div>

Hi!..totally newbie on this:

Got a movie that loads some variables from an XML file. The content of each XML.node fills the corresponding dynamic (on the fly) recipients (mcs).

I know how to do this once, not using a for (loop) basic parser, so, I got stuck with this simple code while I was trying to “make it” with a “loop” parser.

xmlNode = docxml.firstChild;  
totalSlides = xmlNode.childNodes.length;  
firstSlideNode = xmlNode.childNodes[1].childNodes[1];  
currentSlideNode = firstSlideNode;  
currentIndex = 1;

for (var i = 1; i \< xmlNode.childNodes.length; i++){

texto = xmlNode.childNodes\*.childNodes\*.attributes.year; xmlNode.childNodes\*.childNodes\*.attributes.data;  
pic1 = xmlNode.childNodes\*.childNodes\*.attributes.url1;  
pic2 = xmlNode.childNodes\*.childNodes\*.attributes.url2;

}

The idea is to have 2 buttons that change the number of the array sothat I can access the next XML.node without having to write all the code again, neither the dynamic recipients -movie clips- nor the parser. Can´t I make a function from all of these sothat I can call it later?

Thanks a lot!!! :azn:
