# XML:: duplicating movie clip then setting getURL

**URL:** <https://forum.kirupa.com/t/xml-duplicating-movie-clip-then-setting-geturl/202919>\
**Category:** flash\
**Created:** [October 5, 2006, 8:52pm UTC](https://forum.kirupa.com/t/xml-duplicating-movie-clip-then-setting-geturl/202919 "2006-10-05T20:52:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamoose](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lamoose](https://forum.kirupa.com/u/lamoose)\
**Post date:** [October 5, 2006, 8:52pm UTC](https://forum.kirupa.com/t/xml-duplicating-movie-clip-then-setting-geturl/202919/1 "2006-10-05T20:52:55Z")

</div>

here’s my code:

var xnFileURL:Array = new Array();

```
        TOOL.TS.WindowsBehavior.page.files._visible = 0;
        for(var i:Number = 0; i &lt; xnFiles.childNodes.length; i++) {
            var xnFile = xnFiles.childNodes*;            
            var xnFileType = xnFile.attributes.Type;
            var xnFileTitle = xnFile.attributes.Title;
            xnFileURL* = xnFile.attributes.URL;
            
            
            
        duplicateMovieClip(TOOL.TS.WindowsBehavior.page.files, "files"+i, i);
        setProperty(TOOL.TS.WindowsBehavior.page["files"+i], _y, 52*i);

            
            
            TOOL.TS.WindowsBehavior.page["files"+i].textbox.htmlText = xnFileTitle;
            TOOL.TS.WindowsBehavior.page["files"+i].localFileUrl = xnFileURL[counting];
            TOOL.TS.WindowsBehavior.page["files"+i].docBtn1.onPress = function(){
                getURL(xnFileURL*);
                trace("Hello");
            }
        }

```

//

Ok it loads the variable correctly and duplicates the movie clips fine. Now I need to getURL on press but I keep getting the last number of the loop. (xnFileURL[10] in this case). I need it to getUrl according to which duplicate it is.

Anyone got any logic Ideas?
