Rollover gotoandplay AS3

Hi, I’m a noob to flash, and any kind of programming.

I made a very simple site with 2 navigation buttons that trigger different content.

The tutorial I followed use AS2, and I am not sure if this is the right code for AS3.

For my first button.
So when you click it changes to plays frame 1.

Code:
bhome.addEventListener(MouseEvent.CLICK,clickFunction);

function clickFunction(evt:MouseEvent):void {
gotoAndPlay(1);
}
2nd Button
Plays frame 2.

Code:
babout.addEventListener(MouseEvent.CLICK,clickFunction);

function clickFunction(evt:MouseEvent):void {
gotoAndPlay(2);
}

When I test the move the buttons flicker very quickly, and flash says
1021: Duplicate function definition.

If someone can please explain?