Hi
Can anybody point me in the right direction has to amending my code with a for loop of some kind in order for my xml file to be all read into my flash text file.
My code at the moment just reads in the first rule.
var constitutionXML:XML = new XML();
constitutionXML.ignoreWhite = true;
var output:String = "";
constitutionXML.onLoad = function (success){
if (success) {
var constitution:Array = constitutionXML.firstChild.childNodes;
output = constitution[0].childNodes[0].firstChild.nodeValue;
output += "
";
output += constitution[0].childNodes[1].firstChild.nodeValue;
output += "
";
constitution_txt.htmlText = output;
}
else
{
trace ("XML did not load");
}
}
constitutionXML.load("constitution.xml");
The xml file has tags of
<Constitution>
<rules>
<title>*</title>
<body>*</body>
</rules>
</constitution>
Many thanks in advance
Bern