# Help! Using addItem with Dynamic Textbox

**URL:** <https://forum.kirupa.com/t/help-using-additem-with-dynamic-textbox/211249>\
**Category:** Uncategorized\
**Created:** [December 29, 2006, 2:05am UTC](https://forum.kirupa.com/t/help-using-additem-with-dynamic-textbox/211249 "2006-12-29T02:05:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoungNastyMan](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@YoungNastyMan](https://forum.kirupa.com/u/YoungNastyMan)\
**Post date:** [December 29, 2006, 2:05am UTC](https://forum.kirupa.com/t/help-using-additem-with-dynamic-textbox/211249/1 "2006-12-29T02:05:03Z")

</div>

Hello all. I want to dynamically load a list of items into a text box instead of a component list. This is the code I have so far. Unfortunatley, I can only get the component list box to work. Could somebody please look at this and show me how to get the textbox to read items. I know the problem is in line 6… something to do with the whole ‘addItem’ thing (yes, I’m a noob).

```auto
function loadXML(loaded) {
 if (loaded) {
  var nodes = this.firstChild.childNodes;
  for (i=0; i<nodes.length; i++) {
   //theList.addItem(nodes*.firstChild.nodeValue,i);
   _root.myText.text = addItem(nodes*.firstChild.nodeValue,i);
  }
 }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("words.xml");

```
