# Noob treated roughly while parsing XML

**URL:** <https://forum.kirupa.com/t/noob-treated-roughly-while-parsing-xml/313243>\
**Category:** flash\
**Created:** [August 24, 2010, 8:51pm UTC](https://forum.kirupa.com/t/noob-treated-roughly-while-parsing-xml/313243 "2010-08-24T20:51:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamminBill](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@JamminBill](https://forum.kirupa.com/u/JamminBill)\
**Post date:** [August 24, 2010, 8:51pm UTC](https://forum.kirupa.com/t/noob-treated-roughly-while-parsing-xml/313243/1 "2010-08-24T20:51:21Z")

</div>

I’m linking an XML document to a Flash file to control all sorts of things and it’s going quite well until i tried to fill a dynamic text field with a paragraph of type from the XML document. I’ve done this a million times in AS2 and I’ve done it in AS3 using attributes, but this time I’m using childNodes. The dynamic text field is in a movieclip. When I tested it using this code:

var oneComments:String=xmlTestOne.firstChild.childNodes[num].childNodes[1];  
oneClip.txtComment.text=oneComments;

…it sort of worked but I get the element tags along with the paragraph text.

When I try this code:  
var oneComments:String=xmlTestOne.firstChild.childNodes[num].childNodes[1].nodeValue;  
oneClip.txtComment.text=oneComments;

… I get the following error message:

TypeError: Error #2007: Parameter text must be non-null.  
at flash.text::TextField/set text()  
at MethodInfo-48()  
at MethodInfo-49()

When I used the following code just for fun…

var oneComments:String=xmlTestOne.firstChild.childNodes[num].childNodes[1].nodeType;  
oneClip.txtComment.text=oneComments;

I get the number 1. It’s a type 1? Am I supposed to get Type 3? How does a poor oppressed noob do that?
