5 Replies Latest reply on Mar 7, 2007 2:09 PM by kglad

    Action Scripting for buttons

    heathermaxwell17
      Here is my problem.

      I have a two buttons on the mainstage playing two different movie clips. But both buttons are playing the same movie clip even thought the action scripting is different on both.

      Here is my code for the buttons
      The need button-
      on (rollOver)
      {gotoAndPlay("needsquares_mc");
      }
      on (release)
      {getURL(" http://www.grapetree.org/facilities.asp", "_self");
      }

      on (rollOut)
      {gotoAndPlay("main");
      }


      The AM button-

      on (rollOver)
      {gotoAndPlay("amsquares_mc");
      }
      on (release)
      {getURL(" http://www.grapetree.org/introduction.asp", "_self");
      }

      on (rollOut)
      {gotoAndPlay("main");
      }

      I want the movie clips to play on roll over and stop on roll out. Each button also access a web page when clicked. The clicks work but the roll overs go to the same movieclip (the am movie) Can someone explain why this is happening?
        • 1. Re: Action Scripting for buttons
          kglad Adobe Community Professional & MVP
          use the goto methods and identify the movieclip that you want to play:

          • 2. Re: Action Scripting for buttons
            heathermaxwell17 Level 1
            I think more explanation is needed....
            This is for an entry page for a website. One main time line I have two buttons with corresponding movie clips. The label "main" refers to the first frame in the main time line.

            One button is called needbutton and it is supposed to play a movie clip called "needsquare". I have named the instance needsquare_mc on the maintime line. The appearance to the button works (the up,over, down and hit states), the on (release) works, and the roll (out) works but the roll(over) doesn't work- it begins up the "amsquare" movie clip instead of "needsquare"

            The other button called ambutton serves the same purpose as the need button, but with its corresponding movieclip called "amsquare" This button is working properly.

            Basically whatever movie clip is associated with the "ambutton" is the movie clip that appears for either on(rollover).

            Is this a problem with coding? I have exported the instances for actionscripting but that hasn't helped. What am I doing wrong?
            If anyone can help, I can email the swf file!

            Thanks!
            • 3. Re: Action Scripting for buttons
              kglad Adobe Community Professional & MVP
              i don't know if there's a coding problem and i have no idea what you're doing or trying to do.

              i understand you up to '...it begins up the "amsquare" movie clip instead of "needsquare"' which i cannot comprehend.
              • 4. Re: Action Scripting for buttons
                heathermaxwell17 Level 1
                Both buttons bring up the "amsquare" movie clip even though they are programmed to bring up two different clips. I don't understand why that is happening.
                • 5. Re: Action Scripting for buttons
                  kglad Adobe Community Professional & MVP
                  i'm not sure what you mean by "...bring up", but i assume you want something to happen to needsquare and it's not happening.

                  now, i don't see any coding that specifies a movieclip in your rollOver handlers. i see nothing that specifies needsquare in your coding.

                  if those are true buttons, they will gotoAndPlay() the timeline in which they are located. if those are movieclip buttons, they will gotoAndPlay() their own timeline.

                  now, re-read my first response. you should reference the movieclip that each button should control and you need to reference needsquare in one of those buttons.