1 Reply Latest reply on Feb 14, 2013 6:06 AM by ♥Schrene

    How can I assign multiple actions to if/else statements (with xxx.click event)?

    RuesterProd Level 1

      I am trying to add functionality on top of what is written in this tutorial - http://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/

       

      I am trying to have my links (text) change color as well as trigger a symbol animation, and hide the symbol that animates out...

       

      I have this in document.compositionReady -----

       

      sym.setVariable("current", "WelcomeContent", "");

       

      ------------------------------------------------------------

       

      and this on WelcomeButton.click ---------

       

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

         if (current != "") {

            sym.getSymbol(current).play("out");

            sym.getSymbol(current).getSymbolElement().hide();

            sym.getSymbol("WelcomeButton").$("welcome").css("color","red");

         }

      sym.getSymbol("WelcomeContent").play("in");

       

      sym.$("WelcomeContent").show();

      sym.setVariable("current", "WelcomeContent");   

       

      --------------------------------------------------------------------------

      WelcomeButton is my navigation symbol

       

      WelcomeContent is the symbol I want to animate in the WelcomeContent when the WelcomeButton is clicked (and animate out the previous symbol), I then want the WelcomeButton text to turn red (and turn the others back to green), and then hide the previous symbol....

       

      Right now, it'll hide the symbol, BUT it won't play the animation "out", or turn the text red... I'm not sure if I'm doing this right

       

      I know it's a lot...

      here's my sample file... http://www.ruesterprod.com/edgehidesymbols/rpedgerebuild2.zip

       

      Not sure if I'm clear enough.... sorry if I'm confusing...

        • 1. Re: How can I assign multiple actions to if/else statements (with xxx.click event)?
          ♥Schrene Level 4

          As far as I can see your screens ar switching out ok ...

          When you click on welcome ...welcome screen comes up...

          When you click on about about.. about screen pops up and Welocome leaves and so on...

           

          As far as changing the font color goes...

           

          Welcome btn click would look like this:

           

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

          if (current != "") {

          sym.getSymbol(current).play("out");

          sym.getSymbol("AboutButton").$("about").css("color","green");

          sym.getSymbol("ContactButton").$("contact").css("color","green");

          sym.getSymbol("PortfolioButton").$("portfolio").css("color","green");

          sym.getSymbol("WelcomeButton").$("welcome").css("color","red");   

          }

           

          About btn click would look like this:

           

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

          if (current != "") {

          sym.getSymbol(current).play("out");

          sym.getSymbol("AboutButton").$("about").css("color","red");

          sym.getSymbol("ContactButton").$("contact").css("color","green");

          sym.getSymbol("PortfolioButton").$("portfolio").css("color","green");

          sym.getSymbol("WelcomeButton").$("welcome").css("color","green");   

          }

           

          and so on