# Displaying text from XML in incrementing text boxes

**URL:** <https://forum.kirupa.com/t/displaying-text-from-xml-in-incrementing-text-boxes/181847>\
**Category:** flash\
**Created:** [March 13, 2006, 5:40pm UTC](https://forum.kirupa.com/t/displaying-text-from-xml-in-incrementing-text-boxes/181847 "2006-03-13T17:40:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hectors](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hectors/32/2118_2.png) [@hectors](https://forum.kirupa.com/u/hectors)\
**Post date:** [March 13, 2006, 5:40pm UTC](https://forum.kirupa.com/t/displaying-text-from-xml-in-incrementing-text-boxes/181847/1 "2006-03-13T17:40:15Z")

</div>

Hiya, I’m sorry if the title of this post doesn’t explain what I mean too well, here’s some more explanation:

I want to parse the data from an XML file into an array and then put each of the values in the array into a dynamic text box on the stage. The text boxes are name “number1\_txt”, “number2\_txt” &c.

I have managed to set up a loop to parse the XML into my array and also to generate the names of the text boxes dynamically but I can’t get the values from the array to display in the text boxes!

> 

function parseXMLNumbers(doc:XML):Void {   
temp = new Array();  
for (a=0; a\<doc.firstChild.childNodes.length; a++) {  
temp[a] = myXML.firstChild.childNodes[a].firstChild.nodeValue;  
z = a+1;  
var numberBox:String = “number”+z+“\_txt”; this.numberBox.text=temp[a]   
}  
}

If someone would point out what my glaring error is I would be really grateful as i am just getting to grips with actionscript.

Many thanks in advance everyone and thanks for reading this !
