# A lot of Button == A lot of event declares?

**URL:** https://forum.kirupa.com/t/a-lot-of-button-a-lot-of-event-declares/267652
**Category:** Uncategorized
**Created:** [August 4, 2008, 2:33pm UTC](https://forum.kirupa.com/t/a-lot-of-button-a-lot-of-event-declares/267652 "2008-08-04T14:33:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![koneko](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@koneko](https://forum.kirupa.com/u/koneko)
#### Post date: [August 4, 2008, 2:33pm UTC](https://forum.kirupa.com/t/a-lot-of-button-a-lot-of-event-declares/267652/1 "2008-08-04T14:33:34Z")

</div>

# Hi, nice to meet u all. I’m a newbie here, and I’m just start learning AS 3 a few days later. Have a plenty of Question … == in AS 2 == for(i=1;i\<=100;i++) { duplicateMovieClip(“box”, “box”+i, i); eval(“box”+i).\_x=posx; // set to custom position x eval(“box”+i).\_y=posy; // set to custom position y eval(“box”+i).idx=i; } for(i=1;i\<=100;i++) { eval(“box”+i).onRelease=function() { trace(this.idx); //other statement } }

So, basicly, I want to duplicate into a plenty MovieClip, give them a flag variable and give each of them a specific Click event Handler.  
I’ve already success in duplicating them, setting their position,  
but I’m stuck with giving them a variable, and give each of them a Click Handler.

- Am I must spend a hundred row to give each duplicate MovieClip a handler?
- Can the addListener and the ClickHandler method inside the loop?
- How I give the duplicateMovieClip a variable?

Anyone can help me?? I’m sorry if it’s a repost.  
Thx …
