# Using MC name from a loop to call up another MC

**URL:** https://forum.kirupa.com/t/using-mc-name-from-a-loop-to-call-up-another-mc/319092
**Category:** flash
**Created:** [February 8, 2011, 9:39pm UTC](https://forum.kirupa.com/t/using-mc-name-from-a-loop-to-call-up-another-mc/319092 "2011-02-08T21:39:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zaphlin](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@zaphlin](https://forum.kirupa.com/u/zaphlin)
#### Post date: [February 8, 2011, 9:39pm UTC](https://forum.kirupa.com/t/using-mc-name-from-a-loop-to-call-up-another-mc/319092/1 "2011-02-08T21:39:23Z")

</div>

I’ve been searching and trying to figure this out for a while, but haven’t gotten it to work.

I have a bunch of buttons “b1” - “b12” which are set up in a “for” statement. Then on a rollover of each button, I want a popup to appear which I have created called “b(#)popup”. The way I have it set up, when I trace the variable “popup” I get “b(#)popup” like I want, but it is not causing the popup to appear. Does anyone know what my problem is here?

Thanks.

for(i = 1; i \< 13; i++){  
this[“b” + i].onRollOver = rollover;  
this[“b” + i].onRollOut = rollout;  
}

function rollover() {  
this.gotoAndPlay(2);  
**var popup = (this.\_name + “popup”)  
popup.\_visible = true;**  
trace(popup);  
}
