# Rollover gotoandplay AS3

**URL:** <https://forum.kirupa.com/t/rollover-gotoandplay-as3/304189>\
**Category:** flash\
**Created:** [February 2, 2010, 11:40pm UTC](https://forum.kirupa.com/t/rollover-gotoandplay-as3/304189 "2010-02-02T23:40:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evangelizes](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@Evangelizes](https://forum.kirupa.com/u/Evangelizes)\
**Post date:** [February 2, 2010, 11:40pm UTC](https://forum.kirupa.com/t/rollover-gotoandplay-as3/304189/1 "2010-02-02T23:40:05Z")

</div>

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?
