0 Replies Latest reply on Mar 19, 2008 12:01 PM by StanWelks

    Button AS3 Issue

    StanWelks Level 1
      I have 2 buttons on my stage linking to two different sites. I have each button on its own layer with its own instance name and the code for each button on its own separate layer.

      Btn1.addEventListener(MouseEvent.CLICK, loadPage);
      function loadPage(event:MouseEvent):void{
      var myURL:URLRequest = new URLRequest(" http://www.adobe.com/");
      navigateToURL(myURL,"_blank");
      }

      Btn2.addEventListener(MouseEvent.CLICK, loadPage);
      function loadPage(event:MouseEvent):void{
      var myURL:URLRequest = new URLRequest(" http://www.yahoo.com/");
      navigateToURL(myURL,"_blank");
      }

      The first button worked, though when I added the second, I get this error:

      1021: Duplicate function definition.