# \[F5\] XML/flash reading problems

**URL:** <https://forum.kirupa.com/t/f5-xml-flash-reading-problems/20149>\
**Category:** flash\
**Created:** [May 5, 2003, 9:50pm UTC](https://forum.kirupa.com/t/f5-xml-flash-reading-problems/20149 "2003-05-05T21:50:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![417north](https://avatars.discourse-cdn.com/v4/letter/4/50afbb/32.png) [@417north](https://forum.kirupa.com/u/417north)\
**Post date:** [May 5, 2003, 9:50pm UTC](https://forum.kirupa.com/t/f5-xml-flash-reading-problems/20149/1 "2003-05-05T21:50:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 5, 2003, 10:21pm UTC](https://forum.kirupa.com/t/f5-xml-flash-reading-problems/20149/2 "2003-05-05T22:21:08Z")

</div>

oData = getProfile(4);  
and  
return oProfile;  
result in  
oData = oProfile; //where i=4  
is this what you want?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 5, 2003, 10:34pm UTC](https://forum.kirupa.com/t/f5-xml-flash-reading-problems/20149/3 "2003-05-05T22:34:37Z")

</div>

If I call the function:

oData = getProfile(4);

I want that to return (for the following variables):

oData.name = about\_xml.firstChild.childNodes[4].attributes.name  
oData.title = about\_xml.firstChild.childNodes[4].attributes.title  
oData.bio = about\_xml.firstChild.childNodes[4].firstChild.nodeValue

which would result in:

oData.name = Jeff Phelps  
oData.title = Senior Vice President - Trading  
oData.bio = Jeffrey N. Phelps is Senior Vice President…

Am I not doing this right?

Basically, I need to build a list of the names in my XML file, and then be able to call the name, title, and bio as needed. Like I said, I can trace EVERYTHING, I just can’t \*\*\*\*ing pull the info out.
