# XML Flash problem! pls help!

**URL:** <https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208>\
**Category:** Uncategorized\
**Created:** [May 13, 2008, 3:06pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208 "2008-05-13T15:06:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkoes](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rkoes](https://forum.kirupa.com/u/rkoes)\
**Post date:** [May 13, 2008, 3:06pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/1 "2008-05-13T15:06:02Z")

</div>

Hi… am having some problems with displaying loaded xml in flash. The content had loaded successfully but am having problems displaying it into dynamic text fields named txtDate, txtTitle and txtDescription… any ideas? iv attached the xml aswel =)

var xmlNews:XML = new XML();

xmlNews.onLoad = function(){  
\_root.mcNews.txtDate = xmlNews.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.mcNews.txtTitle = xmlNews.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
\_root.mcNews.txtDescription = xmlNews.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;  
};

xmlNews.ignoreWhite = true;  
xmlNews.load(“news.xml”);

---

<div class="post-metadata">

**Author:** ![rkoes](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rkoes](https://forum.kirupa.com/u/rkoes)\
**Post date:** [May 13, 2008, 5:27pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/2 "2008-05-13T17:27:49Z")

</div>

[QUOTE=rkoes;2325588]Hi… am having some problems with displaying loaded xml in flash. The content had loaded successfully but am having problems displaying it into dynamic text fields named txtDate, txtTitle and txtDescription… any ideas? iv attached the xml aswel =)

var xmlNews:XML = new XML();

xmlNews.onLoad = function(){  
\_root.mcNews.txtDate = xmlNews.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.mcNews.txtTitle = xmlNews.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
\_root.mcNews.txtDescription = xmlNews.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;  
};

xmlNews.ignoreWhite = true;  
xmlNews.load(“news.xml”);[/QUOTE]

anyone?

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 13, 2008, 5:36pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/3 "2008-05-13T17:36:51Z")

</div>

If txtDate is the instance name of the text field you would have to use

```auto

_root.mcNews.txtDate.text = xmlNews.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;

```

---

<div class="post-metadata">

**Author:** ![rkoes](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rkoes](https://forum.kirupa.com/u/rkoes)\
**Post date:** [May 13, 2008, 8:22pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/4 "2008-05-13T20:22:59Z")

</div>

[QUOTE=Digitalosophy;2325657]If txtDate is the instance name of the text field you would have to use

```auto

_root.mcNews.txtDate.text = xmlNews.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;

```

[/QUOTE]

yep thats the instance name… tried that stil doesnt work Ⓜ

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 13, 2008, 8:54pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/5 "2008-05-13T20:54:48Z")

</div>

Worked for me. You have an fla I can see?

---

<div class="post-metadata">

**Author:** ![rubberglover](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rubberglover](https://forum.kirupa.com/u/rubberglover)\
**Post date:** [May 13, 2008, 9:54pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/6 "2008-05-13T21:54:47Z")

</div>

You embedded the font on the textfield? Worth creating a new text field, embedding the font, and try chucking the XML to that instead; sometimes the font embeds can go a bit squiffy. Just a thought 🙂

---

<div class="post-metadata">

**Author:** ![rkoes](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rkoes](https://forum.kirupa.com/u/rkoes)\
**Post date:** [May 13, 2008, 10:16pm UTC](https://forum.kirupa.com/t/xml-flash-problem-pls-help/260208/7 "2008-05-13T22:16:30Z")

</div>

il email u the files over digitalosophy, appreciate the help.
