# Loading XML file into flash

**URL:** <https://forum.kirupa.com/t/loading-xml-file-into-flash/128150>\
**Category:** Uncategorized\
**Created:** [November 9, 2004, 11:47pm UTC](https://forum.kirupa.com/t/loading-xml-file-into-flash/128150 "2004-11-09T23:47:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dufranetech](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@dufranetech](https://forum.kirupa.com/u/dufranetech)\
**Post date:** [November 9, 2004, 11:47pm UTC](https://forum.kirupa.com/t/loading-xml-file-into-flash/128150/1 "2004-11-09T23:47:57Z")

</div>

I know this subject has been covered extensively by Kirupa, it’s members and a whole world of other people… However :be:

I am having the silliest problem, and it just proves that I am very new at this indeed! What I am trying to do, is load a very simple xml file into 1 textbox.  
The problem I am running into is that it only loads the first item.

Let’s say this is my xml file.  
\<news\>  
\<new ntitle=“today” ndate=“date” nbody=“content”/\>  
\<new ntitle=“tomorrow” ndate=“date” nbody=“content”/\>  
\</news\>

My code only loads the first one, but not the second node…

newsXml = new XML();  
newsXml.ignoreWhite = true;  
newsXml.onLoad = function(success) {  
if (success) {  
newsitems = this.firstChild.firstChild.attributes;

```
 news_txt.htmlText = newsitems.ntitle + "&lt;br&gt;"+ newsitems.ndate + "&lt;br&gt;"+ newsitems.nbody + "&lt;br&gt;&lt;br&gt;";

```

}  
}  
newsXml.load(“newsxml.xml”);

Obviously there is something wrong with what I’m doing, I have a feeling it may be something so simple… but for the life of me, I can’t see it…

Help
