Toggling 1 movieclip at a time

Hi ,

I’m new to AS3 and kinda stuck. Basically, I have different buttons that toggle movieclips on/off. I have this concept working fine. However, I can’t seem to figure out how to toggle 1 at a time.

To expand, if I press a button, movieclips associated with it will be visible=true, and any other button with associated movieclips currently visible will be visible=false.

If anyone could shed some light, it would be appreciated.

My 1st frame code looks like this:

// start mc as invisible
park1.visible=false;
park2.visible=false;

// visiblility functions
function eventResponse(event:MouseEvent):void
{
if(park1.visible){
park1.visible = false
}else{
park1.visible = true
}
if(park2.visible){
park2.visible = false
}else{
park2.visible = true
}
}
// dot rollover functions
function test(event:MouseEvent):void {
park1info.gotoAndPlay(“play”) ;
}
function test2(event:MouseEvent):void {
park2info.gotoAndPlay(“play”) ;
}

// Event listeners
button_mc.addEventListener(MouseEvent.CLICK, eventResponse);
park1.addEventListener(MouseEvent.ROLL_OVER, test);
park2.addEventListener(MouseEvent.ROLL_OVER, test2);