# Problem with buttons with "for i="

**URL:** <https://forum.kirupa.com/t/problem-with-buttons-with-for-i/196840>\
**Category:** flash\
**Created:** [August 11, 2006, 10:34am UTC](https://forum.kirupa.com/t/problem-with-buttons-with-for-i/196840 "2006-08-11T10:34:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![5TEF](https://avatars.discourse-cdn.com/v4/letter/5/85e7bf/32.png) [@5TEF](https://forum.kirupa.com/u/5TEF)\
**Post date:** [August 11, 2006, 10:34am UTC](https://forum.kirupa.com/t/problem-with-buttons-with-for-i/196840/1 "2006-08-11T10:34:32Z")

</div>

hi,

i make an XML menu…  
i’ve got this pb : ALL button have the same URL ( the last url of my xml file )… what’s wrong ?

this is my code :

```auto

        for (var i = 0; i<total_logos; i++) {
            duplicateMovieClip("btnLogos", "btnLogos"+i, i);
            _this["btnLogos"+i]._x = 50;
            btnOver("btnLogos", i);
            btnOut("btnLogos", i);
            _this["btnLogos"+i].roundedTween(["_y", "_alpha"], [50+(15*i), 100], 1+i/8, "easeOutCubic");
            _this["btnLogos"+i].logoName.text = this.firstChild.firstChild.childNodes*.attributes.nom;
            _this["btnLogos"+i].id = i;
            urlImg = monFolio.firstChild.firstChild.childNodes*.attributes.urlImg;

// pb here :urlImg always = the last image in my xml file....
            _this["btnLogos"+i].onRelease = function() {
                trace(urlImg);
            };
        }

```
