# AS3 linking menus

**URL:** https://forum.kirupa.com/t/as3-linking-menus/275619
**Category:** flash
**Created:** [November 17, 2008, 5:05am UTC](https://forum.kirupa.com/t/as3-linking-menus/275619 "2008-11-17T05:05:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bigmamainthemud](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bigmamainthemud](https://forum.kirupa.com/u/bigmamainthemud)
#### Post date: [November 17, 2008, 5:05am UTC](https://forum.kirupa.com/t/as3-linking-menus/275619/1 "2008-11-17T05:05:07Z")

</div>

Simple.

Two separate MC’s (menu\_mc and menu2\_mc) both export to the MainMenu.as class. Both contain buttons that export to the OButton.as class. Buttons.fla base class is Main.as.

What I want is for menu\_mc and menu2\_mc to work like partners. When I ROLL\_OVER the buttons of one I want the other MC to “hear” it and react the same way. How do I make them “aware” of one another?

I have a friend who pointed me in this direction:  
"First off, both the top menu and the middle menu need to become aware of each other. I don’t actually have flash, so I can’t see how this is set up exactly within the FLA, but you need to do something like this within the class which extends the root:

var m1:MainMenu = mySecondMenuClip;  
var m2: MainMenu = myFirstMenuClip;

m1.setLinkedMenu(m2);  
m2.setLinkedMenu(m1);

setLinkedMenu can add a listened to the other menu so that every time you make a new selection, it knows to update its selection. You have to figure out the details 😉

Secondly, your OButton class needs to broadcast when the mouse rolls over it. Then you can use that pairing above to have both menus rollover in tandem."  
…AND, while I understand something of what he is talking about, I am having trouble getting my mind (and my code) around it. As you may see I have begun to implement the “setLinkedMenu” method but I am not really sure what it is supposed to do OR if I even hav it in the right place.

Thanks for any help you may offer.  
Here are my classes
