# Actionscript 3 Problem with a button

**URL:** <https://forum.kirupa.com/t/actionscript-3-problem-with-a-button/327164>\
**Category:** flash\
**Created:** [February 10, 2012, 6:43am UTC](https://forum.kirupa.com/t/actionscript-3-problem-with-a-button/327164 "2012-02-10T06:43:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leighgoodman](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@leighgoodman](https://forum.kirupa.com/u/leighgoodman)\
**Post date:** [February 10, 2012, 6:43am UTC](https://forum.kirupa.com/t/actionscript-3-problem-with-a-button/327164/1 "2012-02-10T06:43:47Z")

</div>

Hi there,

I am fairly new to actionscript 3.

I am creating an animation. 3 buttons come up during the animation, and when one clicks on them, they should take you to the respective scenes (frame 1).

Now i spent about 3 hours yesterday on various websites, trying out the same code in various ways but nothing worked. I got different errors every time. My button is just a normal button and i created an instance name.

the code is like this (and i have tried variations of it)

[COLOR=#0066CC][/COLOR]button1.[COLOR=#006600]addEventListener[/COLOR][COLOR=#66cc66]([/COLOR]MouseEvent.[COLOR=#006600]MOUSE\_DOWN[/COLOR], mouseDownHandler[COLOR=#66cc66])[/COLOR];  
function mouseDownHandlerCOLOR=#66cc66[/COLOR]:[COLOR=#0066CC]void[/COLOR] [COLOR=#66cc66]{[/COLOR] [COLOR=#0066CC]gotoAndStop[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#cc66cc]1[/COLOR], [COLOR=#66cc66]“Scene2”[/COLOR][COLOR=#66cc66])[/COLOR]; [COLOR=#66cc66]}[/COLOR]

But i keep getting errors. Now im getting an error - "1021 - Duplicate function definition)

Any help would be really appreciated!

Leigh
