4 Replies Latest reply on Sep 7, 2010 7:47 PM by Ned Murphy

    AS3 problem coming from AS 2

    toolmania1

      I get error when moving to AS3 for my buttons.  Here is my AS3 code:

       

      mc_buttonMenu.btn_home.addEventHandler(MouseEvent.CLICK, homeHandler);

      function homeHandler(e:MouseEvent):void
      {
      gotoAndPlay("home");
      }

       

      ReferenceError: Error #1069: Property addEventHandler not found on flash.display.SimpleButton and there is no default value.
          at mainPage3_fla::MainTimeline/mainPage3_fla::frame1()

       

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

       

      I have a movie clip called allPages.  When I reference that in the function homeHandler, I get a different error:

       

       

      mc_buttonMenu.btn_home.addEventHandler(MouseEvent.CLICK, homeHandler);

      function homeHandler(e:MouseEvent):void
      {
      allPages.gotoAndPlay("home");
      }

       

      1120:Acces of undefined property allPages