4 Replies Latest reply on Aug 11, 2014 10:51 AM by enjoijkeee

    Working with actions in Adobe Edge Animate

    enjoijkeee

      Hi!

      I don't have a problem, just a trouble and I need your help.

      I'm developing my personal site with Animate and I need to Toggle Play/Reverse action so I don't know how to do it. Here my site http://prilovski.ru/edge/. Now click action works only on glasses, just click it.

      I need when glasses became big and when I click it image just back on its initial position,I need just playing reverse animation.

      I will very appreciate if you helped me to do it.

      And sorry for my terrible English. I promise I will learn it better.

        • 1. Re: Working with actions in Adobe Edge Animate
          Robyn_cpl Level 2

          Hi,

           

          Is the click of the glasses on the main timeline or on a symbol timeline?

           

          I'm guessing it is on a symbol timeline so you would have

           

          sym.getSymbol("ENTER_SYMBOL_NAME_HERE").playReverse();

           

          Also you will need to do the below:

           

          Add a trigger at the very beginning of the stage timeline or the stage composition ready and add this

           

          sym.setVariable("glasses_click", 0);

          //this is setting a variable from the start

           

          then on your glasses click code have this:

           

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

          //this is getting the value of the variable

          if (glasses_click ==0)

          {

               PLAY MOVE HERE

               sym.setVariable("glasses_click", 1);

          }

          //this is saying if the count is 0 play X then change the count to 1

          else if (glasses_click==1)

          {

               PLAY MOVE BACK HERE

               sym.setVariable("glasses_click", 0);

          }

          //and this is saying else if the count is 1 play X and change the count back to 0

          1 person found this helpful
          • 2. Re: Working with actions in Adobe Edge Animate
            enjoijkeee Level 1

            No, the click is on main timeline. What should I change?

            • 3. Re: Working with actions in Adobe Edge Animate
              Robyn_cpl Level 2

              To be honest I would add the click animations to a symbol.

               

              Main reason for that is that you have more control over your animations and code.

               

              I started with having everything on the main timeline and now since everything is in there own symbols you can control much more.

               

              But if you really don't want to do it that way I'd say keep the code I mentioned before in a trigger at 0 seconds or in the composition ready and on the click code add this:

               

              var glasses_click = sym.getVariable("glasses_click"); //this is getting the value of the variable

               

              if (glasses_click ==0)

              {

                   sym.play("INSERT LABEL NAME HERE");

                   sym.setVariable("glasses_click", 1);

              }//this is saying if the count is 0 play X then change the count to 1

               

              else if (glasses_click==1)

              {

                   sym.playReverse("INSERT LABEL NAME HERE");

                   sym.setVariable("glasses_click", 0);

              }//and this is saying else if the count is 1 play X and change the count back to 0


              You might have to put a label at the end of your click animation so it can play in reverse too and that's the label name you need to add to sym.playReverse.

              • 4. Re: Working with actions in Adobe Edge Animate
                enjoijkeee Level 1

                OK, I'll try to add actions to a symbol, many thanks!