6 Replies Latest reply on May 19, 2014 12:51 AM by Ross_P

    Help Needed - Unpredictable Behaviour When Targeting Symbols

    Ross_P Level 1

      Hi,

       

      I've created a small website in Edge Animate that shows how a piece of scientific apparatus works. The site consists of several animations showing how each part of the apparatus works and has buttons that link to each animation as follows:

       

      Header - Several links to different components of a piece of science apparatus

      Content Area - 6 different animations contained within symbols on the timeline

       

      The problem I am having is that some of the links to the symbols aren't working, despite the code looking fine. Also if I click on a symbol to play an animation in the timeline and then click on it again to restart the animation it doesn't work and will sometimes load different parts of the timeline. It all seems a bit unpredictable, as some click functions successfully trigger animations as I'd expect, whereas others don't or trigger a different animation.

       

      What I want to know is if there is something I am doing wrong and can this be resolved? Or by having several different animations on the timeline am I asking Edge Animate to do too much? I wasn't sure if I'd be better creating a website in Dreamweaver (or another code editor) and then importing all of the animations from Edge Animate individually?

       

      Any ideas / help would be much appreciated. I understand that it is probably difficult to understand the exact issue without seeing the files.


      Many thanks,

       

      Ross

        • 1. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
          jbowden Adobe Employee

          Hello Ross,

           

          It's difficult to provide any useful insight unless you can post some sample code that's not working, or otherwise break down the problems a bit more (it sounds like there may be more than one problem occurring).

           

          Thanks,

          Joe

          • 2. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
            Ross_P Level 1

            Hi Joe,

             

            Sorry, here's the main problem.

             

            This is the click function attached to a button called "sample-injection-text". This works fine:

             

            sym.getComposition().getStage("sample-injection").play(); //plays animation of apparatus

            sym.getComposition().getStage().getSymbol("description-container").play(); //a background coloured box fades in that contains an explanation of the apparatus

            sym.getComposition().getStage().getSymbol("description-text").play("process-3"); //text for the description fades in

             

            The following code doesn't work. It is attached to another button called "separation-text". It should play a symbol called "separation" but instead plays the "sample-injection" symbol above:

             

            sym.getComposition().getStage("separation").play();

            sym.getComposition().getStage().getSymbol("description-container").play();

            sym.getComposition().getStage().getSymbol("description-text").play("process-5");

             

            I hope this helps. Any support would be much appreciated.

             

            Ross

            • 3. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
              jbowden Adobe Employee

              Hi Ross,

               

              Not sure why you're seeing that behavior, but it may be due to an error in your code:

               

              Ross_P wrote:

               

              sym.getComposition().getStage("separation").play();

               

               

              getStage doesn't take an argument. Were you trying to get a symbol named "separation", perhaps?

               

              Maybe this helps,

              Joe

              • 4. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
                Ross_P Level 1

                Hi Joe,

                 

                yes that's correct, I was using getStage to target the main timeline as opposed to targeting nested symbols. Can you tell me what this code should look like if I do not use getStage?

                 

                thanks,

                 

                Ross

                • 5. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
                  jbowden Adobe Employee

                  Hi Ross,

                   

                  It really depends upon where you're issuing the commands from. Using getStage is fine (but not necessary if your calling element is in the same symbol, i.e., if the element is part of the main Stage - in that case, just use sym), but when using getStage(), there should be nothing between its parenthesis. So if there's a symbol instance on the Stage named "separation" and you want to play it, use this:

                   

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

                   

                  rather than this (which was your code above):

                   

                  sym.getComposition().getStage("separation").play();

                   

                  On the other hand, if "separation" is a label on the main timeline that you want to play from (and you are not calling from an element on the main Stage), then use this:

                   

                  sym.getComposition().getStage().play("separation");

                   

                  hth,

                  Joe

                  • 6. Re: Help Needed - Unpredictable Behaviour When Targeting Symbols
                    Ross_P Level 1

                    Thanks Joe, that's fixed it. "separation" was on the main timeline and I wasn't calling it correctly so needed to use the last piece of code that you suggested:


                    sym.getComposition().getStage().play("separation");

                     

                    Another problem that I've now noticed is that if I click from one animation to another and then back again, it plays from the last position where the animation was left (stopped) rather than playing from the label at the start as it should. I hope that makes sense?

                     

                    Any further assistance would be appreciated.


                    Ross