1 Reply Latest reply on Feb 23, 2014 3:36 PM by resdesign

    Click functionality that counts clicks

    forever-rendering

      Hi there,

       

        I've been trying to figure this out for a while now but haven't gotten anywhere.

       

        I want to be able to click a button in Edge Animate once, have it make a symbol do something, then click it again, and then have the symbol do something different.

       

        Basically I want to be able to count the number of clicks the user does with a variable and then make an if/else based on the number that the count variable is. (Unless there's a better way?)

       

        If anyone has any idea of how to do this as a jumping off point I'd be very grateful. Thank you!!

        • 1. Re: Click functionality that counts clicks
          resdesign Adobe Community Professional & MVP

          Do you have one symbol with several labels?

           

          Here is a possible way:

           

          i=-1;

          $(document).click(function(event){

            $(event.target).closest(".clickable").each(function(){

              i++;

              if(i==0){

               sym.getSymbol('ani').play('color');

          sym.getSymbol('ani').$('info').html('color');

              }

              if (i==1){

               sym.getSymbol('ani').play('move');

          sym.getSymbol('ani').$('info').html('move');

              }

              if (i==2){

              sym.getSymbol('ani').play('change');

          sym.getSymbol('ani').$('info').html('change');

              } else{

           

           

            });

          });

           

           

          Sample here:  https://app.box.com/s/cpcp4pjy96tos8fm6li5

          1 person found this helpful