# XML attribute to Dynamic Text Box

**URL:** <https://forum.kirupa.com/t/xml-attribute-to-dynamic-text-box/249298>\
**Category:** flash\
**Created:** [January 17, 2008, 11:52am UTC](https://forum.kirupa.com/t/xml-attribute-to-dynamic-text-box/249298 "2008-01-17T11:52:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [January 17, 2008, 11:52am UTC](https://forum.kirupa.com/t/xml-attribute-to-dynamic-text-box/249298/1 "2008-01-17T11:52:18Z")

</div>

Hi, I am trying to dynamically add titles to boxes from XML.  
My boxes are named block1, block2 etc  
my XML Contents follow  
\<content\>  
\<clip link=“test1”/\>  
\<clip link=“test2”/\>  
\<clip link=“test3”/\>  
\</content\>

My code is as follows (including all the typical XML initiates):

```auto
function loadXML(loaded){
    if (loaded) {
        xmlNode = this.firstChild.childNodes;
        total = xmlNode.length;
        
    for(i=0; i<total; i++){
        description = xmlNode*.attributes.link;
        block*.title_txt.text = description;      
}       
    } else {
        trace("file not loaded!");
    }
}

```

if I remove the for Loop, and make i=1 , and trace xmlNode\*… Then I get “test2”. All seems good.  
Now I want that “test2” to be placed in the dynamic text field of block\*, which has an aptly named “title\_txt” dynamic txt field instance name.

Why does it not place the text in the text field when I run it?

Thanks!!!
