# XML/Flash Problem

**URL:** <https://forum.kirupa.com/t/xml-flash-problem/61306>\
**Category:** flash\
**Created:** [August 17, 2004, 5:30pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306 "2004-08-17T17:30:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![trundrumbalind](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trundrumbalind/32/696_2.png) [@trundrumbalind](https://forum.kirupa.com/u/trundrumbalind)\
**Post date:** [August 17, 2004, 5:30pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/1 "2004-08-17T17:30:20Z")

</div>

Hi, I’m trying to load information from an XML file into a textbox in Flash. Some of the information is just made up for this testing. So, the following code is placed into the first (and only) frame on the timeline along with a dynamic textbox with the variable name “textBox”…

```auto
 textBox = "";
titlesArray = new Array(); 
function pushArray() {
trace (objXML.firstChild.childNodes.length);
for (var count = 1; count < objXML.firstChild.childNodes.length; count++) {
nodeObj = objXML.firstChild.childNodes[count];
titlesArray[count] = nodeObj.attributes.title;
trace(titlesArray[count]);
textBox = titlesArray[count];
}
}
 
// load XML doc
 
objXML = new XML();
objXML.onLoad = loadXML;
objXML.load("xmldocument.xml");
 
// onLoad XML function
function loadXML(success) {
if (success) {
_root.pushArray();
} else {
}
}
 

```

And the XML below is stored in the filename “xmldocument.xml”…

```auto
 
<WEBSITES>
<WEBSITE title="XMLStuff"/>
<WEBSITE title="DavidFox"/>
<WEBSITE title="Thirdone"/>
</WEBSITES>

```

It looks like Flash is returning the wrong amount of nodes in the XML document so I really don’t know what I’m doing wrong.

Any help would be greatly appreciated.

---

<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:** [August 17, 2004, 6:28pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/2 "2004-08-17T18:28:17Z")

</div>

objXML = new XML();  
**objXML.ignoreWhite = true;**  
objXML.onLoad = loadXML;

---

<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:** [August 17, 2004, 6:35pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/3 "2004-08-17T18:35:39Z")

</div>

I’m a \*\*\*\* FOOL!!!

I completely missed that and it’s something I helped somebody else out with before!!!

I guess I don’t practice what I preach!!!

Thanks anyway and take it easy,  
Dave

---

<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:** [August 17, 2004, 6:37pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/4 "2004-08-17T18:37:02Z")

</div>

> [@trundrumbalind](#):
>
> I’m a \*\*\*\* FOOL!!!

They ban the word **[edited]** here!?!?

---

<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:** [August 17, 2004, 9:34pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/5 "2004-08-17T21:34:23Z")

</div>

I wouldn’t elude the filter like that – last time I did I got a firm “hey, don’t do that”. Just passing along my past experience. 😉

(but that is ridiculous, since you can even say the d-word in a G-rated movie, along with \*\*\*\*\*ing and a few other soft curse words)

---

<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:** [August 17, 2004, 9:43pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/6 "2004-08-17T21:43:26Z")

</div>

yeah movies have gone to h… heck

---

<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:** [August 18, 2004, 2:12pm UTC](https://forum.kirupa.com/t/xml-flash-problem/61306/7 "2004-08-18T14:12:15Z")

</div>

Why have a ratings system when everything is socially acceptable? :sigh:
