This is the code that I am using for (http://_clients.417north.com/behavior/missioncap/_swf/about.xml):
about_xml = new XML();
about_xml.onLoad = startProfiles;
about_xml.load(“about.xml”);
about_xml.ignoreWhite = true;
function startProfiles(success) {
if (success == true) {
rootNode = about_xml.firstChild;
totalProfiles = rootNode.childNodes.length;
about_xml.firstChild.childNodes = new Array;
processProfiles(about_xml);
oData = getProfile(4);
}
}
function processProfiles(about_xml) {
// xmlDoc_xml is now a reference to the XML
// object where our information is stored
for (var n = 0; n<about_xml.firstChild.childNodes.length; n++) {
trace(about_xml.firstChild.childNodes[n].attributes.name);
trace(about_xml.firstChild.childNodes[n].attributes.title);
trace(about_xml.firstChild.childNodes[n].firstChild.nodeValue);
}
}
function getProfile(i) {
oProfile = new object();
oProfile.name = about_xml.firstChild.childNodes*.attributes.name;
oProfile.title = about_xml.firstChild.childNodes*.attributes.title;
oProfile.bio = about_xml.firstChild.childNodes*.firstChild.nodeValue;
return oProfile;
}
Then, I’m setting a text box with the value oData.title and nothing is being returned. All of the content is being traced, but I can’t seem to pull any of the data out for use. I’m a bit of a coding newbie, with regards to XML and AS.
Any and all productive help would be greatly appreciated.
Thanks in advance,
Greg