I'm having a problem trying to finish a flash menu for a website. The problem is that when you click on a sub-menu button, it will open the link to that button but it will also open the link to the main menu button (movie clip) it is attached to.

I am using component definitions to put a certain sub-menu with a certain main-menu button. The code I'm writing is in each main-menu button movie clip, there is also a bit of code in the sub-menu movie clip as well just for linking the websites for each of the sites for those sub-menu buttons, but not the main-menu button.

Here is a link to show what the menu looks like:

http://www.kellyscreativesewing.ca/test.html

All the links don't work yet so I suggest hovering over Contact and clicking the Google Maps button so you can see how it would work for all of them.

Here is the code in the contact button movie clip:

this.useHandCursor = true;
this.trackAsMenu = true;
this.stop();

var sb = false;
var getContactUs:URLRequest = new URLRequest("http://www.kellyscreativesewing.ca/contact_us.htm")

this.addEventListener(MouseEvent.CLICK, contactusClick)
function contactusClick(event:MouseEvent):void{
navigateToURL(getContactUs, '_self');
}

this.addEventListener( MouseEvent.ROLL_OVER, over );
this.addEventListener( MouseEvent.ROLL_OUT, out );
if( !this.submenu ){
this.addEventListener( MouseEvent.MOUSE_DOWN, down );
this.addEventListener( MouseEvent.MOUSE_UP, up );
}

function over(e:MouseEvent){
//e.stopImmediatePropagation();
this.gotoAndStop(2);
if( this.submenu !== '' && !sb ){
var cn = getDefinitionByName( this.submenu );
sb = new cn();
sb.y = 50;
sb.x = ( this.offset )? this.offset : 20;
this.addChild( sb );
}
if( sb ){ sb.visible = true; }
}
function out(e:MouseEvent ){
gotoAndPlay(1);
if( sb ){ sb.visible = false; }
}
function down( e:MouseEvent ){
gotoAndStop(3);
}
function up( e:MouseEvent ){
gotoAndStop(2);
}

Here is the code in the sub-menu movie clip:

stop();

var getGoogleMaps:URLRequest = new URLRequest("http://maps.google.ca/maps?f=q&source=embed&hl=en&geocode=&q=B2W+3V1&aq= &sll=44.697633,-63.487909&sspn=0.005834,0.013937&ie=UTF8&hq=&hnear =Dartmouth,+Nova+Scotia+B2W+3V1&t=h&ll=44.698189,-63.488531&spn=0.007321,0.013733&z=16")
btn_googlemaps.addEventListener(MouseEvent.CLICK, googlemapsClick)

function googlemapsClick(event:MouseEvent):void{
navigateToURL(getGoogleMaps, '_blank');
}
var getEmail:URLRequest = new URLRequest("mailto:[email protected]")
btn_email.addEventListener(MouseEvent.CLICK, emailClick)

function emailClick(event:MouseEvent):void{
navigateToURL(getEmail, '_self');
}
var getNewsletter:URLRequest = new URLRequest("http://www.kellyscreativesewing.ca/newsletter.htm")
btn_newsletter.addEventListener(MouseEvent.CLICK, newsletterClick)

function newsletterClick(event:MouseEvent):void{
navigateToURL(getNewsletter, '_self');
}

I hope someone would be able to help, I have a feeling it has to either do with trying to create an if statement that would force it to open one or the other, or that I'm putting the code for the website links in the wrong places or that maybe trackAsMenu isn't working and it's the reason they both open.

Thanks for any feedback.