# Passing variable from MC to MC

**URL:** <https://forum.kirupa.com/t/passing-variable-from-mc-to-mc/205039>\
**Category:** Uncategorized\
**Created:** [October 25, 2006, 4:33pm UTC](https://forum.kirupa.com/t/passing-variable-from-mc-to-mc/205039 "2006-10-25T16:33:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kredd](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kredd](https://forum.kirupa.com/u/kredd)\
**Post date:** [October 25, 2006, 4:33pm UTC](https://forum.kirupa.com/t/passing-variable-from-mc-to-mc/205039/1 "2006-10-25T16:33:03Z")

</div>

hello all, i have a “campus map MC” that is an attachedmovie clip linked from the library to a scrollpane on the main timeline. there is a “info balloon MC” in the “campus map” with a “close” button on the info balloon that hides the balloon.

the campus map has buttons over each bldg. on rollover/rollout the “info balloon MC” appears and disappears. if you click the button it ‘stays’ and the button is disabled so that the rollover/out stop.

button code:

```auto
 
on (rollOver) {
 setProperty(this.bubble,_visible, 100); // info balloon MC nested in the campus map MC
 setProperty(this.bubble,_x, 200);
 setProperty(this.bubble,_y, 50);
}
on (rollOut) {
 setProperty(this.bubble,_visible, 0);
}
on (release){
 setProperty(this.bubble,_visible, 100);
 btn1.enabled = false; // btn1 is name of button
 _global._global.actv_btn = "btn1" // var sent to the close button
}

```

what should happen:  
click a building button…info balloon pops up and button is disabled. ‘close’ button is clicked on the info balloon. info balloon disappears. button is re-enabled.

everything works except the last step of re-enabling.

i know the code works cause if i hard code the button name the re-enabling works.  
i know the var with the button name is successfully passed using trace()  
but replace the hard coded button name with the variable and nothing happens.

my ‘close’ button code(frame scipt):

```auto
 
close_btn.onRelease = function() {
 sp = _global.actv_btn;
 
this._parent[actv_btn].enabled = true; // one method i tried
 
//_root.main_scroller.spContentHolder.sp.enabled = true; // another method
 
setProperty(_root.main_scroller.spContentHolder.bubble,_visible, 0);
 
//trace(sp) // actually equals "btn1" but the code still won't work!
}

```

any ideas?? thanks!

---

<div class="post-metadata">

**Author:** ![kredd](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kredd](https://forum.kirupa.com/u/kredd)\
**Post date:** [October 25, 2006, 9:09pm UTC](https://forum.kirupa.com/t/passing-variable-from-mc-to-mc/205039/2 "2006-10-25T21:09:43Z")

</div>

**_FIXXXED_**

this did it:

```auto
this._parent._parent[actv_btn].enabled = true;

```
