3 Replies Latest reply on Feb 25, 2010 8:20 AM by Ned Murphy

    Is it variable? and how?

    Corefee

      Hello there,

      I have a animation wich works on buttons. And there is a charecter who does the things wich are mensioned on names of buttens.

      Untill then everything is fine, but I would like the charecter to do a different move when involved person clicks on a random button for the, lets say, 5th time.

      I have herd that it is posible with varables, I hope you understood me and will be able to explain how its done.

      Thank you.

        • 1. Re: Is it variable? and how?
          Ned Murphy Adobe Community Professional & MVP

          It is not clear what yopu mean, so you will probably need to explain using a detailed example.  If the idea is that you want clicking the same button to do different things at different times, then you need to create variables that you adjust and use to test if one action or another should be taken.

           

          Just an example, not a literal bit of code...

           

          if(createdVariable == 5){

               // do this

          } else {

               // do that

          }

          // adjust createdVariable

          1 person found this helpful
          • 2. Re: Is it variable? and how?
            Corefee Level 1

            It goes like this.

            There are few buttons as options. When you click one on of them an action happens. A different action for different button.

            When the perticipant (the person who is playing the "game") clicks on any of thoes buttons for the fifth time (including all the buttons, so it does not mather if he clicks one button two times and the rest 3 clicks on others, or all the clicks go for one button) a totaly different action happens, an action which is in another frame.

            I hope this is clear enough, otherwise I will try to explain the situation again


            • 3. Re: Is it variable? and how?
              Ned Murphy Adobe Community Professional & MVP

              I think I understand and my answer remains the same.  You need to have a variable that you adjust and use to determine when to change the action that is taken.  In this case, each time you click a button that variable needs to be incremented by 1.  When that variable reaches a value of 5, the actions that are taken on the next click will be dictated via the conditional that I showed ealier.