Kirupa, first let me start by thanking you for teaching me so much. You have brought me to a new level… unfortunatley, I’m stuck…
I am totally lost and not sure where I went wrong. Let me start from the begining… I created a simple MySQL database and wrote a PHP file which in turn is writing XML. So I called for that php file (using xmlData.load). I’m able to display/read the first three nodes, but no matter what I do I can’t get the last two to display. What am I doing wrong, and what can I do to fix this? I really want to better understand this…
Here is the what the PHP file displays when I view the source:
<?xml version=“1.0”?>
<election>
<district><b>Congress - 3rd</b></district>
<mug>images/DavidMes.jpg</mug>
<candidate><br>David Mejias (D, WF)<br>Peter King (R, I, C)</candidate>
<votes><br>467,483<br>370,987</votes>
<percentage><br>0<br>0</percentage>
</election>
Here is the AS I have calling the XML in:
function loadXML(loaded) {
if (loaded) {
_root.par = this.firstChild.firstChild.firstChild;
_root.district = par;
_root.mugShot = this.firstChild.firstChild.nextSibling.firstChild.nodeValue;
_root.cand = this.firstChild.firstChild.nextSibling.nextSibling.firstChild;
//
_root.votes = ??? // These are the two that I’m lost on???
_root.perct = ??? // These are the two that I’m lost on
//
name_txt.htmlText = _root.district;
placeHolder_mc.loadMovie(mugShot);
cands_txt.htmlText = _root.cand;
votes_txt.htmlText = _root.votes;
perct_txt.htmlText = _root.perct;
} else {
trace(“file not loaded!”);
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“e_xml.php?race=3”);
Thank you so much in advance!