1 Reply Latest reply on Oct 11, 2014 3:58 PM by resdesign

    2 actions in 1 button?

    gutsi007

      Hey im new at Edge Animation, but i made a button that triggers a menu to appears, but i have 2 questions:

       

      1. How can I make my button make the menu appear after 1 click, but when the menu is shown, and you then click the button again, it will play reverse?

       

      2. How do i make the symbol i am using as button so when i hover my mouse over it, the cursor changes as if i was a link?

       

      Thanks!

        • 1. Re: 2 actions in 1 button?
          resdesign Adobe Community Professional & MVP

          Try something like this. Change the code to do what you need. But basically you set a variable on each event to return to the other value.

           

          //set the value of a Symbol variable

          sym.setVariable("onOff", true);

          // click event

          sym.$('btn').click(function(){

            // get the variable

            var onOff = sym.getVariable("onOff");

            if (onOff == true) {

              sym.$('Ellipse').css({'background-color':'green'});

            sym.$('btnLabel').html('Off');

            // reset the variable to false for next click

            sym.setVariable("onOff", false);

            }

            else {

            sym.$('Ellipse').css({'background-color':'red'});

            sym.$('btnLabel').html('On');

            // reset the variable to false for next click

            sym.setVariable("onOff", true);

            }

          });

          '

          I think this is the sample (but I am not sure I made several)

          buttons on-off.zip - Box