3 Replies Latest reply on Jan 23, 2011 7:03 PM by drding

    Duplicate function definition error on buttons

    drding

      Hi there!

       

      Ok first I'm a complete beginner when it comes to Flash so please bare with me.

       

      What I'm looking to do is create a banner that transitions between different photos while there are small square buttons on the side that when the user clicks on them, it jumps to the corrosponding frame where a new photo begins showing. I've seen it a bunch of times on other websites.

       

      After following the advice found here: http://forums.adobe.com/thread/781826?tstart=0

       

      Everything was going well until I hit a snag. When trying to preview my movie I got the following error:

       

      1021: Duplicate function definition

       

      Now, I know there is a very obvious error here in my button scripts, but as I said, I have no idea what I'm doing. Can someone look at my code and tell me what's wrong and what I should change? I'll post all five scripts.

       

      The instance names by the way are "sidebutton1" thru "sidebutton5" if that's any help.

       

      Here's my codes for each of the five buttons (one of these code bits per button):

       

       

      sidebutton1.addEventListener(MouseEvent.CLICK,f);

       

      function f(e:Event):void{

       

      gotoAndPlay(1);

       

      }

       

      --------------------------

       

      sidebutton2.addEventListener(MouseEvent.CLICK,f);

       

      function f(e:Event):void{

       

      gotoAndPlay(100);

       

      }

       

      ---------------------------

       

      sidebutton3.addEventListener(MouseEvent.CLICK,f);

       

      function f(e:Event):void{

       

      gotoAndPlay(200);

       

      }

       

      ----------------------------

       

      sidebutton4.addEventListener(MouseEvent.CLICK,f);

       

      function f(e:Event):void{

       

      gotoAndPlay(300);

       

      }

       

      ----------------------------

       

      sidebutton5.addEventListener(MouseEvent.CLICK,f);

       

      function f(e:Event):void{

       

      gotoAndPlay(500);

       

      }