# In a forloop as assignen

**URL:** <https://forum.kirupa.com/t/in-a-forloop-as-assignen/235368>\
**Category:** flash\
**Created:** [August 10, 2007, 2:28pm UTC](https://forum.kirupa.com/t/in-a-forloop-as-assignen/235368 "2007-08-10T14:28:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [August 10, 2007, 2:28pm UTC](https://forum.kirupa.com/t/in-a-forloop-as-assignen/235368/1 "2007-08-10T14:28:48Z")

</div>

I have a little question beqause I cant figure it out myself, its probably so simple, that I have to be verry embaressed …

On my stage I have 8 buttons, named “knop0”, “knop1”, “knop2”, etc till 8

```auto
for (var a:Number=0; a<9; a++) {
    this["knop"+a].addEventListener(MouseEvent.CLICK, leesMap, a);
}

function leesMap(welke:int):void {
    trace(welke);
}

```

But with this code, **only knop0** does what I expect, the rest from the buttons does nothing.  
I also tried root and stage (are there anymore options ?) but besides errors it gives me nothing, or less 🙂

[SIZE=1]help ! :q:[/SIZE]
