# Error 1021: Duplicate function definition

**URL:** <https://forum.kirupa.com/t/error-1021-duplicate-function-definition/330663>\
**Category:** Uncategorized\
**Created:** [February 24, 2013, 10:15am UTC](https://forum.kirupa.com/t/error-1021-duplicate-function-definition/330663 "2013-02-24T10:15:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaiah\_Bolima](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@Isaiah\_Bolima](https://forum.kirupa.com/u/Isaiah_Bolima)\
**Post date:** [February 24, 2013, 10:15am UTC](https://forum.kirupa.com/t/error-1021-duplicate-function-definition/330663/1 "2013-02-24T10:15:05Z")

</div>

Hello i have little problem… i want to make 2-5 different buttons but have the same action script.  
The 1st one is perfect using the code. but when i make another button and duplicate the action script to link it.  
problem occu Error 1021: Duplicate function definition.

here is my code:

* * *

playPauseToggle\_mc.addEventListener(MouseEvent.CLICK, fl\_togglePlayPause);  
function fl\_togglePlayPause(evt:MouseEvent):void

{

```
if(playPauseToggle_mc.currentLabel == "play")
{
    
    playPauseToggle_mc.gotoAndStop("pause");
}
else if(playPauseToggle_mc.currentLabel == "pause")
{
    playPauseToggle_mc.gotoAndStop("play");
}

```

}

playPauseToggle2\_mc.addEventListener(MouseEvent.CLICK, fl\_togglePlayPause);  
function fl\_togglePlayPause(evt:MouseEvent):void

{

```
if(playPauseToggle2_mc.currentLabel == "play")
{
    
    playPauseToggle2_mc.gotoAndStop("pause");
}
else if(playPauseToggle2_mc.currentLabel == "pause")
{
    playPauseToggle2_mc.gotoAndStop("play");
}

```

}

* * *

Please help me with this one. Thank you in advance.
