2 Replies Latest reply on Dec 11, 2013 4:45 PM by Frank_my

    Reverse animation issue

    Frank_my Level 1

      Hi,

       

       

      I would really appreciate if you could help me because I need it to complete my Capstone Project!!

       

       

      I want to accomplish the following: when you click a rectangle images come to the screen with animation and when animation stops the images stay there. Now when you click another rectangle the images that were load before are animating reverse so they go out of the screen and new images comes in.

       

       

      In a sense I am not sure how to make the following: when a rectangle is pressed it plays reverse the animation of the one that was loaded, and after that it plays his animation.

       

       

      I created 6 symbols that have their own animation but I am not sure what to do next.

       

       

      An example: http://www.youtube.com/watch?v=tTWD9olzYKw#t=2360

       

      Thank you in advance,

      Frank

        • 1. Re: Reverse animation issue
          Frank_my Level 1

          Can someone modify this code so that whatever button you play, then it works. Now for example if you press button 2 it plays animation 2, but if you press button 4 it reverses the animation of 3 and not of 2 which was previously played. The button that you click should play the animation of the previously played...

           

           

           

          sym.setVariable("current", 1);

          sym.$('btn1').click(function(){

          current = sym.getVariable("current");

          if (current==1){

          sym.getSymbol('Symbol_1').play();

          sym.setVariable("current", 2);

          }

          if (current==2){

          sym.getSymbol('Symbol_1').play();

          sym.setVariable("current", 3);

          }

          if (current==3){

          sym.getSymbol('Symbol_1').play();

          sym.setVariable("current", 4);

          }

          if (current==4){

          sym.getSymbol('Symbol_1').play();

          sym.setVariable("current", 1);

          }

           

           

          });

           

           

          sym.$('btn2').click(function(){

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

          if (current==2){

          sym.getSymbol('Symbol_1').playReverse();

          sym.getSymbol('Symbol_2').play();

          sym.setVariable("current", 3);

          }

          if (current==1){

          sym.getSymbol('Symbol_1').playReverse();

          sym.getSymbol('Symbol_2').play();

          sym.setVariable("current", 2);

          }

          if (current==3){

          sym.getSymbol('Symbol_1').playReverse();

          sym.getSymbol('Symbol_2').play();

          sym.setVariable("current", 4);

          }

          if (current==4){

          sym.getSymbol('Symbol_1').playReverse();

          sym.getSymbol('Symbol_2').play();

          sym.setVariable("current", 1);

          }

           

           

          });

           

           

           

           

          sym.$('btn3').click(function(){

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

          if (current==3){

          sym.getSymbol('Symbol_2').playReverse();

          sym.getSymbol('Symbol_3').play();

          sym.setVariable("current", 4);

          }

          if (current==2){

          sym.getSymbol('Symbol_2').playReverse();

          sym.getSymbol('Symbol_3').play();

          sym.setVariable("current", 3);

          }

          if (current==4){

          sym.getSymbol('Symbol_2').playReverse();

          sym.getSymbol('Symbol_3').play();

          sym.setVariable("current", 1);

          }

          if (current==1){

          sym.getSymbol('Symbol_2').playReverse();

          sym.getSymbol('Symbol_3').play();

          sym.setVariable("current", 2);

          }

           

           

          });

           

           

           

           

          sym.$('btn4').click(function(){

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

          if (current==4){

          sym.getSymbol('Symbol_3').playReverse();

          sym.getSymbol('Symbol_4').play();

          sym.setVariable("current", 1);

          }

          if (current==3){

          sym.getSymbol('Symbol_3').playReverse();

          sym.getSymbol('Symbol_4').play();

          sym.setVariable("current", 4);

          }

          if (current==2){

          sym.getSymbol('Symbol_3').playReverse();

          sym.getSymbol('Symbol_4').play();

          sym.setVariable("current", 3);

          }

          if (current==1){

          sym.getSymbol('Symbol_3').playReverse();

          sym.getSymbol('Symbol_4').play();

          sym.setVariable("current", 2);

          }

           

           

           

           

          });

           

          I apprecieate your time,

          Frank

          • 2. Re: Reverse animation issue
            Frank_my Level 1

            Whatever... I found it..