13 Replies Latest reply on May 6, 2013 10:55 AM by jbowden

    from one symbol to another....

    poul_g Level 1

      Hi There..

       

      Can i control one symbol from another symbol via Get Symbol?

      So far i have not been succesful.

       

      If one hold a button and anoher hold a light that has a on and off animation..

      How would the button action look?

       

      Thanks

       

      //Poul

        • 1. Re: from one symbol to another....
          shadowfax007

          Paul-

           

          I've been working on this myself with a lot of help here!

           

          I think I know what you are trying to do:

           

          Create a symbol that has the on and off animation.  At the end of the animation add a "stop"  (<command T or control T in windows?). and click on stop.

          At the beginning of the symbol animation, add a label (command L) and give it a name, like "in" without the quotes.

           

          In the main timeline, add your symbol to the stage by clicking it in the library and dragging to where you want it to play.  Add a trigger and chose "stop" in the timeline.

           

          Now chose an action (click) by clicking on hte {} symbol to the left of the animation in the timeline, chose "+" then chose "click".  Then add the following line:

           

          sym.getSymbol("the name of your symbol you used in the timeline").play("in");

           

           

          That should do it :-)

           

          ps - This is the same as chosing "GetSymbol" and adding the  ".play (labelname"); at the end...

           

          James

          • 2. Re: from one symbol to another....
            elainecc Adobe Employee

            Poul-

             

            James is really close, but I'd suggest one of two things:

            • If your symbol instances are on the same level, try: sym.getParentSymbol().getSymbol("secondInstance").play();
            • If your symbol instances are not on the same level, try: sym.getComposition().getStage().getSymbol("secondInstance").play();

             

            The latter will give you a reference to the top of the stage tree.

             

            -Elaine

            • 3. Re: from one symbol to another....
              shadowfax007 Level 1

              Oops!

              I was one level off I think, thinking about calling symbolB from the stage timeline event (added to SymbolA) depending on the action taking place, instead of actually calling symbolB from "within" symbolA!

               

              James

              • 4. Re: from one symbol to another....
                resdesign Adobe Community Professional & MVP

                Elaine, did you add the request of the path panel to get the symbol paths like in Flash?

                • 5. Re: from one symbol to another....
                  elainecc Adobe Employee

                  Hey, Marie-

                   

                  We talked about it internally, but I noticed it wasn't in our formal requests list.  I just filed an enhancement request.

                   

                  Cheers,

                   

                  -Elaine

                  • 6. Re: from one symbol to another....
                    resdesign Adobe Community Professional & MVP

                    Cool! I hope it will make it! That would be very helpful as I see many struggle with accessing symbols from diverse area of their compositions.

                    • 7. Re: from one symbol to another....
                      poul_g Level 1

                      Thanks for all the help.

                      I will try to see if i can make it work.

                      A simple blog with some quick tutorial files sure would be nice. If i ever get the hold of this i think i will make one

                       

                      I think a "target" icon that could be clicked and then pointing out the right symbol (like you talked about) would be great.

                      It should just work better then flash.. As far as i remember there was different target modes depending on what level you where on.. If possible edge need to do the thinking and make it as simple as possible

                       

                      Thanks again.. i might get back again if i cant get it to work..

                       

                      //Poul

                      • 8. Re: from one symbol to another....
                        poul_g Level 1

                        Hi again..

                        I cant figure it out, sorry

                        I made a simple setup.. a light bulb and a switch.. I made 2 buttons to show what i want.. (the fake ones..)

                        I made the real buttons but without any code.. I made this in edge and uploaded the file.. http://we.tl/VHBq6nuDn9

                         

                        If one of you could help me with this i would be very happy, thanx a million : )  //Poul

                         

                         

                        ex.jpg

                        • 9. Re: from one symbol to another....
                          elainecc Adobe Employee

                          Hi, poul-

                          • Go to the library panel and double click on the icon next to Movie_2
                          • Create a click handler for On
                          • Insert the following code:   

                                    sym.getParentSymbol().getSymbol("bulb").play("on");

                          • Create a click handler for Off
                          • Inser the following code:

                                    sym.getParentSymbol().getSymbol("bulb").stop("off");

                           

                           

                          -Elaine

                          • 10. Re: from one symbol to another....
                            poul_g Level 1

                            It works, thanks Elaine!

                            • 11. Re: from one symbol to another....
                              elainecc Adobe Employee

                              Glad to hear, Poul!

                               

                              -Elaine

                              • 12. Re: from one symbol to another....
                                NunoOnEdge Level 1

                                Hi,

                                 

                                What if you the button is two levels down?

                                I have tried this, but it doesnt work:

                                 

                                sym.getParentSymbol().getSymbol("Step1").getParentSymbol().getSymbol("Garden").play("Step1 _fade");

                                 

                                My button is located on the "Menu" symbol and the animation trigger and animation are at the "Step1" symbol timeline.

                                 

                                Here is the structure:

                                Stage/Step1/Garden/Menu

                                 

                                Thank you!

                                • 13. Re: from one symbol to another....
                                  jbowden Adobe Employee

                                  Hi Nuno,

                                   

                                  Assuming the structure is correct, if you want to play the Step1 timeline from the Menu symbol, try this:

                                   

                                  sym.getParentSymbol().getParentSymbol().play();

                                   

                                  However, it looks like you may actually want to play the Garden timeline from the Step1_fade label? If so, then try this:

                                   

                                  sym.getParentSymbol().play("Step1_fade");

                                   

                                  hth,

                                  Joe