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?