4 Replies Latest reply on May 16, 2007 6:15 AM by Miran Loncaric

    HOW DO I KEEP A BUTTON IN DOWN STATE

    bmfl8
      I have five buttons. I need to program these buttons so that when I click on the button, the information in the down state stays up until another button is pressed. When another button is pressed the information from that down state will stay displayed until I hit another button. PLease help asap!
        • 1. Re: HOW DO I KEEP A BUTTON IN DOWN STATE
          mercl
          you'll have to make switch of some sort
          so when you click you got another keyframe where you have a alternate copy of the btn
          (or just a "dead" graphic symbol) say in your Down state the btn is red
          you'lldo:
          on(press) {
          gotoAndStop("btn1Active");
          }
          etc.

          h.i.h.
          M
          • 2. Re: HOW DO I KEEP A BUTTON IN DOWN STATE
            bmfl8 Level 1
            How and where do I put a copy of this symbol on my timeline without it showing?
            I am assuming that "btn1active" is the name of the symbol?
            I am brand new to action scrpiting, this is my first time. been researching now for about 4 hours. Is this a simple script that I can put on this button that just say, when I click on the button, Hold the down state until another button is active????
            • 3. Re: HOW DO I KEEP A BUTTON IN DOWN STATE
              nITiNkIlLeRmEeRuT
              You want selected state of button. create a movieclip same as on button down state and make it visible once a button is clicked.
              • 4. Re: HOW DO I KEEP A BUTTON IN DOWN STATE
                Miran Loncaric Level 1
                Create new MovieClip instance.
                Inside of it create four empty frames.
                On first frame give it a frame label(for example: "on")
                on second for examlpe "over", third "down", fourth "disabled".
                Now for each frame draw different shape.

                After you've done that, drag the created MovieClip onto the stage and give him a instance name, for example "mc".

                Go to the layer actions and write code(AS3):

                mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
                mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);
                mc.addEventListener(MouseEvent.CLICK, onClick);

                function onOver(e:MouseEvent):void
                {
                e.currentTarget.gotoAndStop("over");
                }

                function onOut(e:MouseEvent):void
                {
                e.currentTarget.gotoAndStop("out");
                }

                function onClick(e:MouseEvent):void
                {
                e.currentTarget.gotoAndStop("down");
                }

                -----------------------
                AS2:

                mc.onRollOver = function():Void
                {
                this.gotoAndStop("over");
                }

                mc.onRollOut = function():Void
                {
                this.gotoAndStop("out");
                }

                mc.onRelease= function():Void
                {
                this.gotoAndStop("down");
                }

                ----------
                Now for more buttons you will need to write for example one for loop...

                HTH