4 Replies Latest reply on May 12, 2008 11:16 AM by dazzlah

    button Q

    dazzlah
      How can I make a button stay a colour once its been clicked?

      D.
        • 1. Re: button Q
          Level 7
          That's a bit of a loaded question - first you'll probably want to use
          MovieClip buttons, and not 'buttons'. That way you have more control. You'll
          need a little AS as well. As a simple example, I'm going to assume you have
          a movieClip with two frames, a stop(); action in frame 1, and an instance
          name of myButton. In that case, some code on the main timeline might be like
          so:

          myButton.onRollOver = function(){
          this.gotoAndStop(2);
          }
          myButton.onRollOut = myButton.onReleaseOutside = function(){
          if(!this.isSelected){
          this.gotoAndStop(1);
          }
          }
          myButton.onRelease = function(){
          this.isSelected = !this.isSelected;
          }

          The clip will alternate between frames 1 and 2 until it's clicked then it
          will stay at frame 2 until clicked again.

          HTH

          --
          Dave -
          www.offroadfire.com
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. Re: button Q
            dazzlah Level 1
            doesnt seem to work.

            I have my object on the stage which I want to use as th button, I have turned it into a movie clip - in the button movie clip I have my actions panel and button panel - the button panel has 2 frames and I have actioned the first frame with 'stop' - on the main stage I have named my button as 'mybutton' i entered the code and it doesn't recognise there is a button there! is there something simple Im missing?

            Thanks

            D.
            • 3. Re: button Q
              Level 7
              >>I have named my button as 'mybutton'

              The code references myButton - case matters. Might be simple as that.

              --
              Dave -
              www.offroadfire.com
              Head Developer
              http://www.blurredistinction.com
              Adobe Community Expert
              http://www.adobe.com/communities/experts/


              • 4. button Q
                dazzlah Level 1
                Ok thanks for this, managed to get this working, now, what if I want the button to go back to its origional state (frame 1) when another button in the same menu is clicked?