2 Replies Latest reply on Sep 8, 2006 4:39 PM by Mister Peanut

    Actionscript on Buttons

    Mister Peanut Level 1


      I have no idea why this isn't working... I've tried attaching this code to a button, to the actions layer, and to a frame... nothing happens!!

      on (release) {
      gotoAndPlay("Home", 1);
      }

      I've also tried using this code on all of them, too:

      home.onRelease = function (){
      gotoAndPlay ("Home", 1);
      }

      I want this button to link the user back to the scene "Home" in frame 1. For the life of me, I can't figure out why it isn't working.

      Any suggestions would be greatly appreciated....
        • 1. Re: Actionscript on Buttons
          NSurveyor Level 2
          Scenes are fairly buggy, try frame lables instead:

          Click on Frame 1 of the Home scene, and in the properties panel, put: home1 for the <Frame Label>. Then, in your script, use _root.gotoAndPlay("home1");
          • 2. Re: Actionscript on Buttons
            Mister Peanut Level 1
            still nothing...

            In my home scene, I have an actions layer. In scene 2, I also have an actions layer. I have labelled the frame in the actions layer in the home scene "home1".

            In the actions layer in scene 2 I have attached the following code:

            home.onRelease = function (){
            _root.gotoAndPlay("home1");
            }

            after I test the movie, a blank "Output" screen pops up (I don't know what this is...), and the home button will not work.
            Perhaps I am putting the script in the wrong place? Hmmm, it seems like it should be straightforward, as I've done it in other sites before, but it just won't work... Any other theories? Are scenes always so buggy?

            Thanks for your time and patience...

            Brad