3 Replies Latest reply on Jan 25, 2012 11:35 PM by kglad

    Problems with button in AS3 in CS5

    Razzi_A

      I've been trying to get a simple button to work, but I'm having some trouble.

       

      How do you set a button's name? I tried putting it in the library as "button1" but my actionscript:

       

      stop();

      button1.addEventListener(MouseEvent.CLICK, advance);

      function advance(event:MouseEvent) {

           gotoAndStop(5);

      }

       

      does not work; in fact even the stop command does nothing and it loops around its five frames.

       

      If I replace "button1" with "stage" the stop command functions, but then the button isn't the trigger--clicking anywhere jumps to frame 5.

       

      I believe the problem I have is with the "button1.addEvent..." line. I'm not sure how to connect my picture of the button with "button1."

       

      I called it button1 and I tried checking "Export for Actionscript and putting button1 as the class, but none of that worked.

       

      Could this problem have to do with the fact that I'm not on administrator on this computer?