7 Replies Latest reply on Nov 12, 2013 2:34 AM by elainecc

    button click on and click off issues

    MrCasso

      hi guys

       

      Ok so currently I have a button that when pressed makes an animated symbol pop up and play. Once the animation has finished the movie stops. I would like for the user to press the same button again to play the symbol's  'out' animation so everything returns to normal. Currently my button has this action applied: sym.getSymbol("pgica").play("in"); In refers to the label where the animation starts. Further down the symbol's time line is another label called 'out' with the animation playin in reverse. I would very much like the user to click the same button to trigger the'out' animation but am totally lost. It works fine with roll over roll out but I need users to click. Any help greatly appreciated.

       

      Thanks

        • 1. Re: button click on and click off issues
          resdesign Adobe Community Professional & MVP

          Check out my blog on edgeHero about that. There is an onff button sample you can look at. CHeck out the one that used set and getVariable.

           

          http://www.edgehero.com/articles/interactivity

          1 person found this helpful
          • 2. Re: button click on and click off issues
            MrCasso Level 1

            Hi, thanks for the link, but I think that's beyond my skill level, I've only  just picked this programme up. Also, from what I gather the examples on your blog are for a toggle. which from my limited understanding turns things on and off.

             

            The symbol I have is an animation. I gues what I'm trying to achieve is, imagine a help button, that users click on. A bubble then pops up and animates with some info text. Once red, the user can then hit the button to close the help bubble.

             

            Originaly, my simple had a close button on, which when clicked tells Edge to play the 'out' animation, this worked fine until I hade mutiple buttons.  as the symbols were overlapping in the stage, it all went a bit wrong because the user could click the buttons on found on the other symbols which were behind each other.

             

            Cor I hope that makes sense.

            • 3. Re: button click on and click off issues
              resdesign Adobe Community Professional & MVP

              You probably need to use a variable to check what you are doing. This was my reason to direct you to the button on off because the principle is the same.

              You check a variable when the button is clicked and then add a state which tells the button that next time it is clicked something will happen.

               

              For your buttons to work individually on the stage, you could use the display on/off so that they are visibile only when you want them to be visible and the same for the symbols.

               

              But I am not sure I totally understand how things are set up in your composition. There are multiple ways to do things and it is usually up to you to think what is the best way to accomplish something.

               

              If you want you can PM me your file with some explanation and I will look at it and see if I can help you further.

              1 person found this helpful
              • 4. Re: button click on and click off issues
                MrCasso Level 1

                hi, me again.

                 

                Ok I seem to have solved the issue with this code for the buttons

                 

                var test = sym.getVariable("template");

                if (test == false) {

                          sym.getSymbol("template").play("out");

                          sym.setVariable("template", true)

                } else {

                          sym.getSymbol("template").play("in");

                          sym.setVariable("template", false)

                }

                 

                The issue I have now is that if you click another button before you close the current button, the help bubble pops up over the top. As you can imagine, looks a bit nasty.

                 

                Here is a demo of what I mean

                 

                http://www.designersassemble.co.uk//stuff/web/advert.html

                 

                Thanks so much for your help

                • 5. Re: button click on and click off issues
                  elainecc Adobe Employee

                  Hi, MrCasso-

                   

                  Can you post your project files for us to look at?  You should ZIP up everything in the project file and upload it to a service like the Creative Cloud, DropBox, or Google Drive.

                   

                  Thanks,

                   

                  -Elaine

                  • 6. Re: button click on and click off issues
                    MrCasso Level 1

                    Hi Elaine

                     

                    Thanks for getting back to me. Seems to be all sorted now. I used a click to play the animation and roll out to close it. Seems to have done the job

                     

                    thanks again

                     

                    Paul

                    • 7. Re: button click on and click off issues
                      elainecc Adobe Employee

                      Awesome, great to hear!

                       

                      -Elaine