19 Replies Latest reply on Dec 20, 2013 5:24 AM by resdesign

    play one symbol after the other

    amatschos

      In my Composition there some cases I have to play one symbol. In a few cases it is necessary two play sequential e.g. symbol A an then symbol B. It have to look like one animation. Is there an easy way of calling?

       

      Thanks,
      Alexander

        • 1. Re: play one symbol after the other
          amatschos Level 1

          Hello? Is there anybody out there?

          • 2. Re: play one symbol after the other
            obliviousjd

            you could do something like on symbol A completion

             

            sym.getParentSymbol().getSymbol("B").play();

            //calls symbol A's parent and the parent calls for symbol B to play

             

            or

             

            sym.getComposition().getStage().getSymbol("B").play()

            //calls the composition which calls the stage which calls for symbol B to play

             

            i don't know if this will look seamless,

             

            Jonathon Davis

            • 3. Re: play one symbol after the other
              elainecc Adobe Employee

              Hi, amatschos-

               

              It was the Thanksgiving holiday here in the States, so I'm guessing that

               

              You can play two symbol instances right after each other in the timeline using Playback Actions.  First, make sure autoplay for your symbols is unchecked:

              autoplay.png

               

              Then, on your main timeline, your symbol should have a "Playback" lane.  Select your first symbol and select the plus next to Playback, and then choose "Play" or "Play From":

              playfrom.png

              You can then line up your playback actions to play one after the other:

              lineup.png

               

              Hope this helps!

               

              -Elaine

              1 person found this helpful
              • 4. Re: play one symbol after the other
                amatschos Level 1

                Hi Jonathon,

                I don´t understand how these calls could play symbol A and then symbol B

                 

                Thnaks,
                Alexander

                • 5. Re: play one symbol after the other
                  amatschos Level 1

                  Hi Elaine,

                   

                  I have different symbols - eg. A, B, C - with diffrent long timeline and in special cases I have to put after a Symbol D, E or F to one of the first.
                  And I want to call the symbols with an javascript outside of edge.

                   

                  Thanks,
                  Alexander

                  • 6. Re: play one symbol after the other
                    heathrowe Most Valuable Participant

                    Alex

                     

                    In Elaines screenshot, see where she added mySymbol1, it is set to Play at 0, and on the timeline you can see an arrow pattern that dictates how long that particular animation is. So where the pattern ends, you add another symbol Playback action, like she has captured for mySymbol2.

                     

                    Hope this helps clarify

                     

                    Darrell

                    • 7. Re: play one symbol after the other
                      obliviousjd Level 1

                      Hello Alexander,

                       

                      sym.getParentSymbol().getSymbol("B").play();

                      This doesn't call symbol A and then symbol B, this just calls symbol B after Symbol A is complete. so symbol A is already called.

                       

                      so here is what i did:

                      1. Created Symbol A and Symbol B

                      2. Created a Timeline animation for both Symbol A and Symbol B

                      3. In Symbol B i created a event trigger (ctr t) at 0:00 and clicked "stop".

                      // This is so that Symbol B does not play when the animation starts

                      4. In Symbol A i created a Timeline Action (the curly brackets {} on the far left of the actions timeline) i used "Complete" and entered in the following code

                      sym.getParentSymbol().getSymbol("B").play();

                      5. When i called on Symbol A it would play, however Symbol B won't play because of step 3, then when Symbol A is complete it will trigger its Timeline Action (step 4) which it would execute the above code.

                       

                      // I made images guideing through the process like Elanie did however i can't upload images

                       

                      edit: "And I want to call the symbols with an javascript outside of edge." I did not see this ill look into that.

                      • 8. Re: play one symbol after the other
                        obliviousjd Level 1

                        To edit the symbols outside of edge open up the name_edgeActions.js file

                        you should see some code like

                        //=========================================================

                         

                           //Edge symbol: 'A'

                           (function(symbolName) {  

                         

                           })("A");

                           //Edge symbol end:'A'

                         

                         

                           //=========================================================

                         

                           //Edge symbol: 'B'

                           (function(symbolName) {  

                         

                           })("B");

                           //Edge symbol end:'B'

                         

                        // under Edge symbol 'A' in the function add

                              Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "complete", function(sym, e) {

                                 sym.getParentSymbol().getSymbol("B").play();

                              });

                             //Edge binding end

                         

                        // under Edge symbol 'B' in the function add

                              Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {

                                 sym.stop();

                             });

                             //Edge binding end

                         

                        // You should get something like

                         

                        //=========================================================

                         

                           //Edge symbol: 'A'

                           (function(symbolName) {  

                         

                              Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "complete", function(sym, e) {

                                 sym.getParentSymbol().getSymbol("B").play();

                         

                         

                              });

                              //Edge binding end

                         

                         

                           })("A");

                           //Edge symbol end:'A'

                         

                         

                           //=========================================================

                         

                           //Edge symbol: 'B'

                           (function(symbolName) {  

                         

                              Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {

                                 sym.stop();

                         

                         

                              });

                              //Edge binding end

                         

                         

                           })("B");

                           //Edge symbol end:'B'


                        • 9. Re: play one symbol after the other
                          amatschos Level 1

                          Hello heathrowe, hello obliviousjd,

                           

                          thanks for your help.

                          But sorry, I didn´t understand how could I use the code for an external javascript loop.

                          Here is a little sequenz of my code:

                          with the random-mode, i don´t know witch animation would be the last for a special animation. In the cases would be start an animation an if in the web-applikation is a special value satisfied, i have to play  a special animation seamless at the animation before. But it could be everytime another animation. I hope you could follow my confused thoughts .

                           

                          if (value == 1){

                                      // random animation witch calls function of edge symbols

                                      switch(getRandom(0,2))

                                      {

                                      case 0:

                                              prof_neg1a();

                                              break;

                                      case 1:

                                              prof_neg1b();

                                              break;

                                      case 2:

                                              prof_neg1c();

                                              break;

                                      }

                                  }

                                  else if (value == 2){

                                      // random animation witch calls function of edge symbols

                                      switch(getRandom(0,2))

                                      {

                                      case 0:

                                              prof_neg2a();

                                              break;

                                      case 1:

                                              prof_neg2b();

                                              break;

                                      case 2:

                                              prof_neg2c();

                                              break;

                                      }

                                  }

                                  else if (value == 3){

                                      prof_neg2c();

                                  }

                                 

                                  //Check for special animation which play after one of the top?

                                  if (lastslider == "rauchen" && $( "#sl_rauchen" ).slider("option", "value") == 4){

                                      //Sonderani Rauchen

                                     prof_sonder1a();

                                  }

                                  else if (lastslider == "genussmittel" && $( "#sl_genussmittel" ).slider("option", "value") == 4){

                                      //Sonderani Alkohol

                                     prof_sonder2a();

                                  }

                                  else if (lastslider == "sport" && $( "#sl_sport" ).slider("option", "value") == 3){

                                      //Sonderani Sport

                                      prof_sonder3a();

                                  }

                          • 10. Re: play one symbol after the other
                            amatschos Level 1

                            supplement: I need no timeline action. I need to know when the symbol with his including symbols is complete. I need a event witch shows when the animimation is ready.

                            It have to be different symbols!

                             

                            Thanks,
                            Alexander

                            • 11. Re: play one symbol after the other
                              obliviousjd Level 1

                              there is a function called isPlaying() you could use that to see if it is playing or not, there are also two functions that could help with that the getDuration() can be used to find a symbol duration and the getPosition() function can be used to find out where in the timeline the animation is. Sorry i couldn't help yesterday and i can't give a full answer till later tonight but i would try setting a variable to getDuration() and using an if statement to see if the animation is complete or not.

                              1 person found this helpful
                              • 12. Re: play one symbol after the other
                                elainecc Adobe Employee

                                Hi, Alexander-

                                 

                                There are a couple of things you can do here.  If your grandchildren symbols are not repeating, you can simply set a trigger in your child symbol to call the second symbol.  This would look like this:

                                 

                                // Go up one level and then across to the symbolB instance

                                sym.getParentSymbol().getSymbol("symbolB").play();

                                 

                                Otherwise, you can go the more complex route and start using event listeners.

                                 

                                Hope that points you in the right direction,

                                 

                                -Elaine

                                • 13. Re: play one symbol after the other
                                  obliviousjd Level 1

                                  Hello Alexander,

                                  Ok so let me see if i fully understand, so what you are trying to do is randomly select a symbol to play from A,B,C then after that symbol is complete you want to seemlessly play another random symbol that is either D,E,F?

                                  • 14. Re: play one symbol after the other
                                    amatschos Level 1

                                    @obliviousjd: yes, that´s the point

                                    • 15. Re: play one symbol after the other
                                      obliviousjd Level 1

                                      Awsome i made a quick prototype and it worked for me! here is what i did:

                                       

                                      first make sure A,B,C,D,E,F symbols all have the stop() at 0:00

                                      i made a event called compositionready (you can find it by clicking on the top right {} "open actions" in the properties panel when selecting the stage) i then entered in the following code

                                      var randomNum = Math.floor((Math.random()*3)+1);

                                      if (randomNum == 1){

                                                sym.getComposition().getStage().getSymbol("A").play();

                                      }

                                      else if (randomNum == 2){

                                                sym.getComposition().getStage().getSymbol("B").play();

                                      }

                                      else {

                                                sym.getComposition().getStage().getSymbol("C").play();

                                      }

                                       

                                      then i went into the Symbols A,B,and C and created "complerte" events (found on the top left {} in the timeline) for all of them and entered in the following code

                                      var randomNum = Math.floor((Math.random()*3)+1);

                                      if (randomNum == 1){

                                                sym.getComposition().getStage().getSymbol("D").play();

                                                // like i said in post three you could use sym.getParentSymbol().getSymbol("D").play();

                                      }

                                      else if (randomNum == 2){

                                                sym.getComposition().getStage().getSymbol("E").play();

                                                // like i said in post three you could use sym.getParentSymbol().getSymbol("E").play();

                                      }

                                      else {

                                                sym.getComposition().getStage().getSymbol("F").play();

                                                // like i said in post three you could use sym.getParentSymbol().getSymbol("F").play();

                                      }

                                      this would then call for a random symbol A,B, or C once the composition loaded, then when either one of those completed it would randomly select D,E, or F
                                      Does this all make seanse and is this what you are looking for?

                                      • 16. Re: play one symbol after the other
                                        amatschos Level 1

                                        Hi obliviousjd,

                                         

                                        sorry, for my slow response, I was ill this week.


                                        Thank you for your work. I think that's close to it. I try to adapt this on my project.
                                        Is it possible that you give me your project provides for download?

                                        Thanks, Alexander

                                        • 17. Re: play one symbol after the other
                                          obliviousjd Level 1

                                          hey sorry for the slow response aswell
                                          i can give you the project once i have acsess to the computer it is currently on

                                          I'm glad to help

                                          • 18. Re: play one symbol after the other
                                            obliviousjd Level 1

                                            i don't know how i would go about uploading an edge animate file