# Assign action to dynamic button

**URL:** <https://forum.kirupa.com/t/assign-action-to-dynamic-button/136275>\
**Category:** Uncategorized\
**Created:** [February 3, 2005, 1:59pm UTC](https://forum.kirupa.com/t/assign-action-to-dynamic-button/136275 "2005-02-03T13:59:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelisfun](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@pixelisfun](https://forum.kirupa.com/u/pixelisfun)\
**Post date:** [February 3, 2005, 1:59pm UTC](https://forum.kirupa.com/t/assign-action-to-dynamic-button/136275/1 "2005-02-03T13:59:31Z")

</div>

Can anyone please help me with this???

I am creating a dynamic group of buttons based on a string that i pass to flash file. There is no problem creating these buttons (that I do duplicating a movieclip from my library) The question is, that i need these buttons to open another page, all buttons the same, but passing a parameter. How can i assign the action to my buttons?

My frame 1 code is at this moment:

for (i=0; i\<totalItems; i++) {  
\_root.attachMovie(‘loader’, ‘imageLoader’+i, getNextHighestDepth());  
\_root[‘imageLoader’+i].\_x = 132\*(i);  
\_root[‘imageLoader’+i].\_y = 1;  
\_root[‘imageLoader’+i].imageLoader.loadMovie(\_root[‘img’+i]);  
}

The string that flash receives is something like  
totalItems=3&img0=pic01.jpg&id0=01&img1=pic02.jpg&id1=02

and the parameter i want to pass to the new page is the value of ‘id’.

Thanks in advance!
