# Multiple MCs as buttons

**URL:** https://forum.kirupa.com/t/multiple-mcs-as-buttons/188763
**Category:** flash
**Created:** [May 10, 2006, 3:50pm UTC](https://forum.kirupa.com/t/multiple-mcs-as-buttons/188763 "2006-05-10T15:50:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ollie1](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ollie1/32/2180_2.png) [@ollie1](https://forum.kirupa.com/u/ollie1)
#### Post date: [May 10, 2006, 3:50pm UTC](https://forum.kirupa.com/t/multiple-mcs-as-buttons/188763/1 "2006-05-10T15:50:26Z")

</div>

I have created a MC that acts like a button (rollover, rollout states). However when i try to add more to the frame they don’t want to work:  
This is the AS for one button:

```auto
this.button1.onRollOver = function(){
	button1.gotoAndPlay("_over");
}
this.button1.onRollOut = function(){
	button1.gotoAndPlay("_out");
}

```

And when I add a second I just use the same but change the instance names to suit the second MC.

```auto
this.button1.onRollOver = function(){
	button1.gotoAndPlay("_over");
}
this.button1.onRollOut = function(){
	button1.gotoAndPlay("_out");
}

this.button2.onRollOver = function(){
	button2.gotoAndPlay("_over");
}
this.button2.onRollOut = function(){
	button2.gotoAndPlay("_out");
}

```

Any ideas what I am doing wrong? This is really bugging me!
