# Multiple MCs using the same instance name. Only 1 of them working for the function

**URL:** <https://forum.kirupa.com/t/multiple-mcs-using-the-same-instance-name-only-1-of-them-working-for-the-function/268340>\
**Category:** Uncategorized\
**Created:** [August 12, 2008, 7:40pm UTC](https://forum.kirupa.com/t/multiple-mcs-using-the-same-instance-name-only-1-of-them-working-for-the-function/268340 "2008-08-12T19:40:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ohls](https://avatars.discourse-cdn.com/v4/letter/o/59ef9b/32.png) [@Ohls](https://forum.kirupa.com/u/Ohls)\
**Post date:** [August 12, 2008, 7:40pm UTC](https://forum.kirupa.com/t/multiple-mcs-using-the-same-instance-name-only-1-of-them-working-for-the-function/268340/1 "2008-08-12T19:40:59Z")

</div>

Got 9 MCs which I want a rollover effect for. I made 1, copied it and it’s instance name 9 times. And made this script:

```auto
function menu_btn_over() {
    myTween = new mx.transitions.Tween(_root.main.menu.btn.btn_parent, "_x", mx.transitions.easing.Strong.easeOut, _root.main.menu.btn.btn_parent._x, 0, inspeed);
}
function menu_btn_out() {
    myTween = new mx.transitions.Tween(_root.main.menu.btn.btn_parent, "_x", mx.transitions.easing.Strong.easeOut, _root.main.menu.btn.btn_parent._x, -160, inspeed);
}
_root.main.menu.btn.onRollOver = function() {
    menu_btn_over();
};
_root.main.menu.btn.onRollOut = function() {
    menu_btn_out();
};

```

But it only works for one of the buttons. The one I made the copies from.

I figured you could do this since it’s the same MC? I could be wrong though. If that is the case, is there some way I can make the same action for every button without having to make a bunch of calls for each one? for example:

“\_root.main.menu.btn1 \<and\> btn2 \<and\> btn3 \<and\> etc.onRollOut = function() {”

Thanks!
