6 Replies Latest reply on May 22, 2010 2:47 PM by Bart Cross

    Problem with buttons

    Bart Cross Level 4

      I have the following scripts for buttons:

       

      SummerStrings10.onRelease = function() {
              getURL("summer/suzuki.html","_self");
          }
         
      SummerArt10.onRelease = function() {
              getURL("summer/artcamp.html","_self");
          }
         
      SummerTheatre10.onRelease = function() {
              getURL("summer/theatre.html","_self");
          }
         
      SummerChamber10.onRelease = function() {
              getURL("summer/chamber.html","_self");
          }
         
      Summer10.onRelease = function() {
              getURL("summer.html","_self");
          }

       

      I get the hand pointer to indicate they are buttons, but they do not work. These buttons are based on this:

       

      Skip.onRelease = function() {
              getURL("about.html","_self");
          }

       

      which does work. I have checked the syntax, the button instance names, the existance of the files themselves, and they are correct, but the pages do not appear as they should. Any ideas, I'm stymied.

        • 1. Re: Problem with buttons
          Ned Murphy Adobe Community Professional & MVP

          Put trace statements inside the functions to see if the buttons are targeted by the code, as in....

           

          SummerStrings10.onRelease = function() {

                  trace("SS10 clicked");
                  getURL("summer/suzuki.html","_self");
              }

          1 person found this helpful
          • 2. Re: Problem with buttons
            Bart Cross Level 4

            I put the trace statement in, but nothing gets traced.

             

            I inserted the trace into the statement that works and it does show the trace.

            • 3. Re: Problem with buttons
              Ned Murphy Adobe Community Professional & MVP

              Your buttons are not communicating with their functions... the buttons/instance names are the highest on the suspect list.  Do you happen to animate these buttons into place or otherwise have instances on different keyframes where the buttons are not assigned insdtance names?  Objects that get tweened need to have instance names at every keyframe, and the code for the buttons needs to be assigned on the instances that get the user interaction.

               

              And just in case--it's happens alot... instance names are assigned via the Properties panel when you place an object on the stage.  They are not the names assigned to objects in the library.

              1 person found this helpful
              • 4. Re: Problem with buttons
                Bart Cross Level 4

                OK, I have these button placed in a movie clip so that they are animated simultaneouly as a block, the movie clip is animated, not the buttons.

                 

                Could that be the problem?

                • 5. Re: Problem with buttons
                  Ned Murphy Adobe Community Professional & MVP

                  That code needs to be in the same timeline as the buttons.  Otherwise, if that code is in the timeline the movieclip lives in you would need to target the buttons via the mc's instance name... as in...

                   

                  mcName.SummerStrings10.onRelease = function() {
                          getURL("summer/suzuki.html","_self");
                      }

                  • 6. Re: Problem with buttons
                    Bart Cross Level 4

                    You're a genius. I knew it was something really simple that I missed.