# MC through a variable trouble

**URL:** <https://forum.kirupa.com/t/mc-through-a-variable-trouble/30945>\
**Category:** flash\
**Created:** [September 16, 2003, 4:11pm UTC](https://forum.kirupa.com/t/mc-through-a-variable-trouble/30945 "2003-09-16T16:11:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moshlp](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@moshlp](https://forum.kirupa.com/u/moshlp)\
**Post date:** [September 16, 2003, 4:11pm UTC](https://forum.kirupa.com/t/mc-through-a-variable-trouble/30945/1 "2003-09-16T16:11:34Z")

</div>

hi, i´m having trouble trying to target a MC through a variable.  
e.g.:I have 3 buttons: the MC for the button 1 is called btn1,for button 2 is btn2,and so on.Now I save the name of the MC in a variable called btn, but when I target the MC it doesn´t work…my button actions are like this:  
btn starts as “”

Code:  
if (btn != “”) {  
btn.gotoAndPlay(32);  
}  
pictures.gotoAndPlay(2);

```
  btn = "pictures"; 

```

}

I´ve placed a trace(btn) and it looks fine, but when i used this code in other button and the MC pictures was loaded before, it doesn´t target the MC pictures…any ideas??
