2 Replies Latest reply on Sep 3, 2009 1:10 PM by ghotarama

    Why won't my menu buttons work?

    ghotarama

      I'm a total beginner at actionscript, but I've learnt some very, very basic things for my university course. I now have an assignment to hand in where I need to make a drop-down menu to link to other pages. My tutor helped me with the script for this (I don't understand it), and I've got a movie clip for each button which brings up a sub-menu containing more buttons.

       

      Now, my problem is that the buttons in the sub-menu don't work. On each button, I've written this:

      on(release){gotoAndStop('pagename');}

      ...which is exactly what I put for the non-submenu buttons. The non sub-menu buttons work perfectly well, but the sub-menu buttons won't. What's going on?

       

      If it helps, this is the script for the movie clip. I don't understand it, though:

       

      onClipEvent(mouseMove) {

      if (this._currentframe == 2){

      this.hi

      }

      }

      onClipEvent (enterFrame){

      if(this.hitTest(_root._xmouse,_root._ymouse,true)){

      if(this._currentframe == 1){

      this.gotoAndStop(2);

      }

      }else{

      if(this._currentframe == 2){

      this.gotoAndStop(1);

      }

      }

      }

       

      I'd appreciate some help with this. It's too late to figure it out before I hand in my assignment (which is due in a matter of mere hours), but I'd still like to know for the future.

        • 1. Re: Why won't my menu buttons work?
          andreasfridholm

          try this one:

          on (release) {     _root.gotoAndStop("pagename");

           

          the _root.goto...

          says that it should go the the top layer to find the pagename.. dont know if thats the prob, but you can try?

           

          Date: Thu, 3 Sep 2009 13:59:49 -0600

          From: forums@adobe.com

          To: andreasfridholm@hotmail.com

          Subject: Why won't my menu buttons work?

           

           

          I'm a total beginner at actionscript, but I've learnt some very, very basic things for my university course. I now have an assignment to hand in where I need to make a drop-down menu to link to other pages. My tutor helped me with the script for this (I don't understand it), and I've got a movie clip for each button which brings up a sub-menu containing more buttons.

           

          Now, my problem is that the buttons in the sub-menu don't work. On each button, I've written this:

          on(release){gotoAndStop('pagename');}

          ...which is exactly what I put for the non-submenu buttons. The non sub-menu buttons work perfectly well, but the sub-menu buttons won't. What's going on?

           

          If it helps, this is the script for the movie clip. I don't understand it, though:

           

          onClipEvent(mouseMove) {

          if (this._currentframe == 2){

          this.hi

          }

          }

          onClipEvent (enterFrame){

          if(this.hitTest(_root._xmouse,_root._ymouse,true)){

          if(this._currentframe == 1){

          this.gotoAndStop(2);

          }

          }else{

          if(this._currentframe == 2){

          this.gotoAndStop(1);

          }

          }

          }

           

          I'd appreciate some help with this. It's too late to figure it out before I hand in my assignment (which is due in a matter of mere hours), but I'd still like to know for the future.

          >

          1 person found this helpful
          • 2. Re: Why won't my menu buttons work?
            ghotarama Level 1

            Thanks, it worked! I also just found another answer on an older post by someone else who had the same problem. It turns out the answer is to put _parent. in front of the gotoAndStop. But they both work!

             

            Thanks so much - now I can fix up my assignment just in time!