5 Replies Latest reply on May 23, 2009 4:47 AM by Ned Murphy

    Button ActionScript 2.0

    ute.thomas99@googlemail.c

      Hello, I have a button and defined 3 different layouts in the states Up, Over and Down. If the user clicks on the button and moves the cursor out of the area after the mouse click, the layout of the cursor should still show the "Down-layout", just to indicate that the user has already clicked the button. This state should be active until the user clicks on another button. How has this to be solved? Thanks in advance for your help. Best regards Ute

        • 1. Re: Button ActionScript 2.0
          Ned Murphy Adobe Community Professional & MVP

          You need to use movieclips as buttons instead of button symbols if you want to retain certain button states for user interaction.  Buttons cannot be held in any state and will always reset to their Up condition when the mouse leaves.

          • 2. Re: Button ActionScript 2.0
            ute.thomas99@googlemail.c Level 1

            Hi Ned, it's clear now! Sorry for bordering you again. Regards, Ute

            • 3. Re: Button ActionScript 2.0
              Ned Murphy Adobe Community Professional & MVP

              No bother at all... I wouldn't be here if I didn't enjoy "trying" to help

              • 4. Re: Button ActionScript 2.0
                ute.thomas99@googlemail.c Level 1

                Hi Ned,

                 

                now I changed my buttons to movieclips, but I don't get that what I want:

                when the user - after having clicked on the mc "cereluna_btn_inst" - rolls out his mouse out of the area, then frame 1 is shown.

                It is clear for me that I have this behaviour because I use this scripting below. But I don't know how to change the script, so that frame 2 is shown as long as "cereluna" is played.

                 

                /* cereluna */

                kollektion.cereluna_btn_inst.onRollOver = function(){

                    kollektion.cereluna_btn_inst.gotoAndStop(2);

                };

                kollektion.cereluna_btn_inst.onRollOut  = function(){

                    kollektion.cereluna_btn_inst.gotoAndStop(1);

                };

                kollektion.cereluna_btn_inst.onRelease = function(){

                    gotoAndPlay("cereluna");

                };

                 

                "kollektion" is a mc; in this mc I have "mc-buttons" like "cereluna_btn_inst". These mc buttons have two frames:

                frame 1: a grey picture, frame 2 a highlighted picture. The result should be: if "cereluna" is played, frame 2

                should be "active" even when the user moves the cursor out of the area.

                 

                 

                Best regards,

                Ute

                • 5. Re: Button ActionScript 2.0
                  Ned Murphy Adobe Community Professional & MVP

                  "if "cereluna" is played, frame 2 should be "active" even when the user moves the cursor out of the area"

                   

                  It would be easy to hand you an answer, but it wouldn't be helping you develop your skill.  What you need to do is create code that does what you just said you want to do.  Pay attention to what you said and try to imagine it in terms of coding logic, variables, and commands...  think of the conditions you just defined... they are each codable.  Figure out how to manipulate your code to realize those conditions.