# Loop through add onrollover

**URL:** https://forum.kirupa.com/t/loop-through-add-onrollover/301398
**Category:** Uncategorized
**Created:** [December 8, 2009, 9:33pm UTC](https://forum.kirupa.com/t/loop-through-add-onrollover/301398 "2009-12-08T21:33:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)
#### Post date: [December 8, 2009, 9:33pm UTC](https://forum.kirupa.com/t/loop-through-add-onrollover/301398/1 "2009-12-08T21:33:50Z")

</div>

why isnt’ this working:

for (i=1; i\<26; i++) {

```
mc = this["item"+i];
mc.id = i;

mc = this["item"+i];
mc.id = i;

this["item"+mc.id].onRollOver = function() {
    trace("i:"+i+" mc.id:"+mc.id);
    if (this["item"+mc.id].overtree == false) {
        this["item"+mc.id]._xscale = 110;
        TweenLite.to(this["item"+mc.id],0.2,{_xscale:110, _yscale:110});
        TweenLite.to(this["item"+mc.id+"text"],0.3,{_alpha:100});
    }
};

```

}

the trace out when i rollover the buttons looks like this:

i:26 mc.id:25  
i:26 mc.id:23  
i:26 mc.id:22

i tried this too and it didn’t work:  
this[“item”+i].onRollOver
