5 Replies Latest reply on Feb 28, 2014 12:30 AM by Saurav

    Using Edge Commons Parallax: Trouble with getSymbol

    efreistadt

      Hello all,

       

      I'm having trouble.

       

      I have an element, "button", and have given it a mouseover event, to call symbol, "animation", and play from the beginning of the symbol timeline.

       

      Right now I have written, "var mySymbolObject = sym.getSymbol("animation").play();" in the mouseover event for my "button" element.

       

      I have followed online tutorials, but still cannot seem to get this to work. I'm wondering if it is due to my timeline being controlled by the scrolling as this is a Edge Commons Parallax composition, and perhaps that is what is confusing the call to play the symbol.

       

      I do not want the symbol to be visible unless it is activated by the mouseover "button". And I want the symbol to be played from its beginning when I mouseover "button", and then play from reverse when I mouseout of "button"

       

      I appreciate any insight you all may offer.


      Best,

      Eric

        • 1. Re: Using Edge Commons Parallax: Trouble with getSymbol
          Saurav Adobe Employee

          Hi Eric,

           

          Please refer the attached file  . You can set the display option of the symbol to off on the main timeline and then write the code as provided in the attached example .

           

          Thanks

          Saurav

          1 person found this helpful
          • 2. Re: Using Edge Commons Parallax: Trouble with getSymbol
            efreistadt Level 1

            Thank you Saurav,

             

            That works—though now I have two further questions.

             

            1. Let's say that I want the symbol "animation" to be played from beginning when I mouseover "button", but not played reverse until "button" is clicked. What is happening is "animation" is replaying from the beginning everytime I mouseover, which I only want it played once, until the click plays from reverse. How do I set the mouseover to play "animation" only once, no matter how many mouseovers occur, until clicked to play reverse?

             

            2. I want "button" to expand "animation" on click, but then collapse on another click. How can I assign "button" to play symbol "animation" on click, but then if there is a second click "animation" plays from reverse (i.e. Boolean true/false)?

             

            Thank you so much for any further help!

            Eric

            • 3. Re: Using Edge Commons Parallax: Trouble with getSymbol
              Saurav Adobe Employee

              Hi Eric ,

               

              For the first question you can set a variable in the compositionReady function which will act as a flag which will help to make sure that animation plays only once until reverse animation is played through click event . Please refer the attached file .

               

              For the second question can you please elaborate your problem in detail ? Sorry for not understanding what you meant by "exapnd animation " and " collapse animation "

               

              Thanks

              Saurav

              1 person found this helpful
              • 4. Re: Using Edge Commons Parallax: Trouble with getSymbol
                efreistadt Level 1

                Thank you again Saurav,

                 

                For the second question, I am meaning that on click the symbol "animation" would play, and then on the second click "animation" would play from reverse.

                 

                Is that clear enough?

                Eric

                • 5. Re: Using Edge Commons Parallax: Trouble with getSymbol
                  Saurav Adobe Employee

                  Hi Eric ,

                   

                  There might be many ways to do the play and play reverse using click operation as described by you but this is what I think could be done .

                   

                  We can set a variable in our compositionReady function   sym.setVariable("count", 0);

                   

                  Then in the click handler of the symbol we can write the following code

                  var x = sym.getVariable("count");

                   

                   

                  var mySymbolObject = sym.getSymbol("Symbol_1");

                   

                  //Now check if you have clicked once then play otherwise play reverse .

                   

                  if(x%2 == 0)

                  {

                            mySymbolObject.play();

                  }

                  else

                  {

                            mySymbolObject.playReverse();

                  }

                  x++;

                  // Set the value of a Symbol variable

                  sym.setVariable("count",x);

                   

                  Please refer the attached composition . Hope it helps

                   

                  Thanks

                  Saurav