# Adding unique dynamic text fields to duplicated movieclips

**URL:** https://forum.kirupa.com/t/adding-unique-dynamic-text-fields-to-duplicated-movieclips/169719
**Category:** Uncategorized
**Created:** [November 18, 2005, 6:21pm UTC](https://forum.kirupa.com/t/adding-unique-dynamic-text-fields-to-duplicated-movieclips/169719 "2005-11-18T18:21:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Samurai](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Samurai](https://forum.kirupa.com/u/Samurai)
#### Post date: [November 18, 2005, 6:21pm UTC](https://forum.kirupa.com/t/adding-unique-dynamic-text-fields-to-duplicated-movieclips/169719/1 "2005-11-18T18:21:39Z")

</div>

Hey All,

```
  I'm working on a piece for work. I need to figure out how to add unique dynamic text fields to duplicated movieclips. Unique as in unique instance names and variable names. Thanks for any help that anyone can provide.

```

I have a movieclip on the stage that contains a dynamic text field.

the text field will house text that is being pulled from an xml file.

What I need is to have the dynamic text field in all the duplicated movieclips have a unique instance name and variable name.

I assume that a nested for loop would be required, but I’m not sure as I am not the greatest actionscripter. Here’s what I have so far:

myPhoto = new XML();  
myPhoto.ignoreWhite = true;  
myPhoto.onLoad = function(success) {

// populate the amount of rows based on the amount of nodes  
rows = this.firstChild.childNodes.length;

// enter how many columns are needed  
columns = 3;

// starting position of the first movieclip (holder)  
xpos = 20;  
ypos = 20;

// spacing between each holder  
vspace = 1;  
hspace = 10;

// the width and height of the holder movieclip  
wclip = holder.\_width;  
hclip = holder.\_height;

// counter  
theclip = 1;

// make the grid  
for (var i = 0; i\<rows; i++) {  
for (var j = 0; j\<columns; j++) {  
var thegrid = holder.duplicateMovieClip(“holder”+theclip, theclip+1);  
thegrid.\_x = xpos+((wclip+hspace)\*j);  
thegrid.\_y = ypos+((hclip+vspace)\*i);  
theclip++;  
}  
}  
}  
myPhoto.load(“thumbnails2.xml”);
