Next and the previous nodes in the XML

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; = 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 =;
else {
trace(“Could not load XML file”);
xmlFile = new XML();
xmlFile.ignoreWhite = true;
xmlFile.onLoad = loadXMLData;