# Dynamic button and parameter

**URL:** <https://forum.kirupa.com/t/dynamic-button-and-parameter/316754>\
**Category:** flash\
**Created:** [December 1, 2010, 6:07pm UTC](https://forum.kirupa.com/t/dynamic-button-and-parameter/316754 "2010-12-01T18:07:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cavanhaki](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@cavanhaki](https://forum.kirupa.com/u/cavanhaki)\
**Post date:** [December 1, 2010, 6:07pm UTC](https://forum.kirupa.com/t/dynamic-button-and-parameter/316754/1 "2010-12-01T18:07:20Z")

</div>

Hi, how is possible passing parameter inside button.  
Sample.

for(var i:Number = 0; i\<totalArray-1; i++) {  
var item\_mc = mc.attach.attachMovie(“boxEven”, “boxEven” + i, i);  
item\_mc.title.htmlText = item\_mc;  
item\_mc.btnListaEventos.onRelease = function () {  
loadMovie(“lista.swf?listid=” + i + “&tit=” + item\_mc.title.htmlText, container);  
};  
}

The problem is when I click and any button the value in the button is every the last item loaded and never the real value clicked. Why? And how make correct?  
Any help?  
Thanks
