New to XML and just picked it up from the tutorial.
I'm just not getting the output I want.
here is the AS code in flash
ActionScript Code:
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(sucess) {
if (sucess) {
processDATA(data_xml);
}
};
data_xml.load('xmlResource.xml');
function processDATA(xml_data) {
for (a in xml_data.firstChild.childNodes) {
for (b in xml_data.firstChild.childNodes[a].firstChild.childNodes) {
trace("a=" + a +" b=" + b + " " + xml_data.firstChild.childNodes[a].firstChild.childNodes[b]);
}
}
}
XML file
Code:
<INFO>
<TUTORS>
<TUTOR major="CIS" year="Senior">Ge, Yan</TUTOR>
<TUTOR major="CIS" year="Senior">Oguntunde, Olusola</TUTOR>
</TUTORS>
<RESOURCES>
<RESOURCE><a href="http://www.temple.edu/counseling/services.html#casa" target="_blank"><font color="#FF0000">CASA</font></a></RESOURCE>
<RESOURCE><a href="http://www.temple.edu/counseling/services.html#cert" target="_blank"><font color="#FF0000">CERT</font></a></RESOURCE>
<RESOURCE><a href="http://www.temple.edu/disability/" target="_blank"><font color="#FF0000">Disability Services</font></a></RESOURCE>
<RESOURCE><a href="http://www.temple.edu/counseling/services.html#sace" target="_blank"><font color="#FF0000">SACE</font></a></RESOURCE>
</RESOURCES>
</INFO>
I hoped to access the value and display it as...
a=1 b=0 <a href="http://www.temple.edu/counseling/services.html#casa" target="_blank"><font color="#FF0000">CASA</font></a>
a=1 b=3 <a href="http://www.temple.edu/counseling/services.html#sace" target="_blank"><font color="#FF0000">SACE</font></a>
a=1 b=2 <a href="http://www.temple.edu/disability/" target="_blank"><font color="#FF0000">Disability Services</font></a>
a=1 b=1 <a href="http://www.temple.edu/counseling/services.html#cert" target="_blank"><font color="#FF0000">CERT</font></a>
a=0 b=1 Oguntunde, Olusola
a=0 b=0 Ge, Yan
Any ideas as to why my output is...
// From the TRACE...
a=1 b=0 <a href="http://www.temple.edu/counseling/services.html#casa" target="_blank"><font color="#FF0000">CASA</font></a>
a=0 b=0 Ge, Yan