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.