# Next and the previous nodes in the XML

**URL:** https://forum.kirupa.com/t/next-and-the-previous-nodes-in-the-xml/289287
**Category:** Uncategorized
**Created:** [May 28, 2009, 2:37pm UTC](https://forum.kirupa.com/t/next-and-the-previous-nodes-in-the-xml/289287 "2009-05-28T14:37:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![z0rr0](https://avatars.discourse-cdn.com/v4/letter/z/f19dbf/32.png) [@z0rr0](https://forum.kirupa.com/u/z0rr0)
#### Post date: [May 28, 2009, 2:37pm UTC](https://forum.kirupa.com/t/next-and-the-previous-nodes-in-the-xml/289287/1 "2009-05-28T14:37:40Z")

</div>

hy to all.  
i have a book style movie (next page,previous … ).so I managed to load all content (title,text,author) from xml,but I don’t know is how to load next/previous node from xml file on a button click.the only way i manged to do that is to load everything (from xml) on every page of the book,but the problem is when i press previous page it displayes for a short time the text from another page and then the normal text that should be displayed.:no\_love:

here is the code i use:

> 

function loadXMLData(loaded) {  
if (loaded) {  
\_root.titlu = this.firstChild.childNodes[4].childNodes[0].firstChild.nodeValue;  
\_root.pret = this.firstChild.childNodes[4].childNodes[1].firstChild.nodeValue;  
\_root.descriere = this.firstChild.childNodes[4].childNodes[2].firstChild.nodeValue;  
\_root.link = this.firstChild.childNodes[4].childNodes[3].firstChild.nodeValue;  
titlu\_txt.text = \_root.titlu;  
pret\_txt.text = \_root.pret;  
descriere\_txt.text = \_root.descriere;  
link.text = \_root.link;  
}  
else {  
trace(“Could not load XML file”);  
}  
}  
xmlFile = new XML();  
xmlFile.ignoreWhite = true;  
xmlFile.onLoad = loadXMLData;  
xmlFile.load(“text.xml”);
