3 Replies Latest reply on May 24, 2013 10:14 AM by AMULI

    Actions Question.

    DMD-Ryan Level 1

      I am very new to Edge.  I have been experimenting using EDG to give DPS apps some animations.  I have Googled this question with little to no results so I turn to the community for help and or guidance.


      My question is, is it possible to have "touchstart" perform two different actions for the same element?  I want to have an animation element play once (auto play) then touch to play in reverse and then touch again to play from beginning not play in reverse again like it is currently doing.


      I have tried using two actions like "play reverse" and then adding "play" a line below to it with no luck.  I have tried using labels as well to no avail.


      I am not a coder and know little to nothing about scripts or java so if the answer is you need to understand this better to get it to work then that's all I need to hear.  Im not looking for someone to do the work for me.


      Any help would be greatly appreciated. Thanks.





        • 1. Re: Actions Question.
          AMULI Level 4

          Hi Ryan,


          Look at this thread : http://forums.adobe.com/thread/1204999?tstart=0


          Here, a global variable (accessible from everywhere) is used to store the current label of the headline in the nested symbol.


          Then, depending on the label targeted by the clicked button being after or before the current label, a play() or a playReverse() is executed.


          Your problem is very near : conditional execution of play() or playReverse(), based on the value of a variable, say firstTouch. Roughly, the logic would be :



          sym.setVariable("firstTouch", true);



          if (sym.getParentSymbol().getVariable("firstTouch")==true)



            sym.getComposition().getStage().setVariable("firstTouch", false);

          } else {


            sym.getComposition().getStage().setVariable("firstTouch", true);




          • 2. Re: Actions Question.
            DMD-Ryan Level 1

            Thank you Gil for the help!

            • 3. Re: Actions Question.
              AMULI Level 4

              You'll need to adapt to your particuliar structure. I copied sym.getParentSymbol() because my code  was in a symbol nested directly in the stage. If it's nested deeply, use sym.getComposition().getStage() instead.

              And if it isn't nested use sym.


              Is it understandable to the "non-coder" ? Do not hesitate to ask for explanations if needed.