1 Reply Latest reply on Nov 5, 2012 7:39 AM by josh.dura

    add timeline action to see if button was clicked


      I want to add an if statement in the timeline to see if a button was clicked.




      if (aboutmeBtn.click == true){








      OR... I want to be able to add mutiple play options on one click...




      if(sym.getPosition() == 3000){




        • 1. Re: add timeline action to see if button was clicked
          josh.dura Adobe Employee

          Your best bet for finding out if a button has been clicked or not, would be to set a symbol variable on the click event of the object. Then, when you get to a point in your file that you need to check whether or not it has been clicked, you just use an if statement to check that variable...


          So, for the click event, it would be something simple like:


          //set the variable to true

          sym.setVariable("isClicked", true);

          //log that the button has been clicked

          console.log("i just clicked it");


          Then, when you need to check it, you do something like so:


          //get the variable

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


          //check if it has been clicked. log it.


                    console.log("has been clicked");

          } else {

                    console.log("has not been clicked");