Hello everyone,
Im building a fiction diary for an upcoming dutch movie.
Im loading the text into a dynamic text field, the text is stored in a .XML file.
Im using a next and previous button to go to next or previous days (duh) but the buttons are also working when there isnt any information in the .XML file.
Instead of showing actual text it just shows “undefined”.
Is there any way to tell the buttons to not go to the next node if its not there?
I attached the .fla so you can check out the code.
I’ve been looking for a fix for ages now and this is my last resort.
Thanks in advance 
//EDIT//
This is the actual code im using to load in the XML data:
function leesXML(geladen) {
if (geladen) {
_root.content2.tekstVeldje01.htmlText = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.content2.tekstVeldje02.htmlText = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
trace (_root.content2.tekstVeldje01.htmlText);
}
}
onzeGegevens = new XML();
onzeGegevens.ignoreWhite = true;
onzeGegevens.onLoad = leesXML;
onzeGegevens.load("XML/dagboek.xml");
Now im just looking for a way to make flash go to the next node and read out that info when someone presses the go to next entry button.
Nick
Quick answer, without looking at the actual code, you can simply resolve this by adding something like this:
if (this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue == undefined) {
yourtextfield.text._visible=false;
} else {
yourtextfield.text._visible=true;
yourtextfield.text = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
}
Righto, ive been trying alot of different things and someone i feel that im getting there.
The code im trying to get to work atm is this one:
function leesXML(geladen) {
if (geladen) {
_root.tekstVeldje01.htmlText = this.firstChild.childNodes[0].childNodes*.firstChild.nodeValue;
_root.tekstVeldje02.htmlText = this.firstChild.childNodes[0].childNodes[j].firstChild.nodeValue;
}
}
var i = 0;
var j = 1;
var pewpew = _root.tekstVeldje01.htmlText = this.firstChild.childNodes[0].childNodes*.firstChild.nodeValue;
var wepwep = _root.tekstVeldje02.htmlText = this.firstChild.childNodes[0].childNodes[j].firstChild.nodeValue;
volgende.onRelease=function(){i++, j++, trace(i), trace(j), pewpew, trace(pewpew), trace(wepwep);
};
vorige.onRelease=function(){i--, j--, trace(i), trace(j), pewpew, trace(pewpew), trace(wepwep);
};
onzeGegevens = new XML();
onzeGegevens.ignoreWhite = true;
onzeGegevens.onLoad = leesXML;
onzeGegevens.load("XML/dagboek.xml");
It increases i + j, and (in my mind) should then change the text because the child number increases.
But it doesnt 
Could anyone check it out?