10 Replies Latest reply on Mar 28, 2014 9:20 PM by claursen

    "Rollover active state" and "current marking"

    IronADDT Level 1

      I'd like to set in a menu, create with Edge Animate, a "current marking" function (url parameters).

       

      Example:

      1) a button in the menu with url "/en/compay.php";

      2) the user click on the button in the home page (/index.php), but when open "/en/company.php" the button not more rollover but view only the "active state".

       

      Is it possible?

       

      Thanks.

        • 1. Re: "Rollover active state" and "current marking"
          elainecc Adobe Employee

          Hi, Iron ADDT-

           

          Yes, you will need to do this by managing your state via variables or some equivalent.  I have a general concept of saving state into variables in this blog post:

           

          http://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/

           

          Search for "state management" and you can read a little bit more about how to save the variable.

           

          Then, when your animation starts (or at any point), you can do a query on the status of the page or read a variable and then set your animation to the correct starting spot.

           

          Hope that points you in the right direction!

           

          Thanks,

           

          -Elaine

          1 person found this helpful
          • 2. Re: "Rollover active state" and "current marking"
            claursen Level 1

            Hi Elaine,

             

            Thanks for your example! very helpful! One quick question though. I have the buttons inside another symbol. Once I have that, the concept doesn't work.

             

            I tried replacing:

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

            with

            sym.getComposition().getStage().getSymbol("TEST").getSymbol("green").play("in");

             

            Any idea what I am doing wrong? and how to do it?

             

            Thanks!

             

            Christian

            • 3. Re: "Rollover active state" and "current marking"
              resdesign Adobe Community Professional & MVP

              Where is your symbol compare to the main timeline and from where are you calling it - the main timeline or another symbol?

              • 4. Re: "Rollover active state" and "current marking"
                claursen Level 1

                Hi Resdesign,

                 

                Thank you for your help.

                 

                I have my own more complex project, but to wrap my head around learning the code, I took Elaine's example above and basicly put the buttons inside another symbol.

                 

                So there's the main stage. On it, is a symbol called TEST. Inside this symbol are the 3 buttons and 3 symbols that Elaine made (this is in her project all in the main timeline).

                 

                Does that help explain it?

                • 5. Re: "Rollover active state" and "current marking"
                  resdesign Adobe Community Professional & MVP

                  One of the things the most frustrating in Animate is to figure out the scope of symbols to use them properly. My dream is that some day we can have a path panel for symbols but it is a little tricky since there is a difference between the breadcrumb you get when you go into a symbol and the reality because sometime your change the name of a symbol when you use it.

                  But this is another discussion.

                   

                  Could you try this:

                   

                  sym.getSymbol("TEST").getSymbol("green").play("in");

                  1 person found this helpful
                  • 6. Re: "Rollover active state" and "current marking"
                    claursen Level 1

                    Thanks, Yes. A path panel is a great idea. Anyway to help those who don't code too much would be very helpful.

                     

                    I tried your line but unfortunately it didn't work. Thanks for your help though! very much appreciated!

                     

                    I just don't know enough of the html5/java code to figure this out. It's related to either the symbols or the variable I'm guessing.

                    I dont know if the variable can be used in other symbols. Or if one needs global variables.

                     

                    I think I will go with another solution to finish the project.

                    • 7. Re: "Rollover active state" and "current marking"
                      resdesign Adobe Community Professional & MVP

                      Can you post a link to your files?

                      • 8. Re: "Rollover active state" and "current marking"
                        IronADDT Level 1

                        Ok, I've understood that is impossible to view the "active state" for a rollover image/menu on the active url page.

                        I read the blog post but I didn't see where is the example about "active state" in a menu.

                         

                        Other question... is it available a simple code (javascript) that tell to the animation that if the page has the url "/en/company.php" view a specific symbol (symbol that is view only when the user is in a specific url page... for example php use "if, else")?

                        It's probably a more complicated method, but I can not have 20+ equal animations on a site only to change the "active state" in a menu.

                         

                        I hope to see soon a "snippets archive" with more examples "just ready to use" for Edge Animate.

                         

                        Thanks

                        1 person found this helpful
                        • 9. Re: "Rollover active state" and "current marking"
                          IronADDT Level 1

                          Is it available a tutorial or an example only for "menus", with the current marking function?

                          • 10. Re: "Rollover active state" and "current marking"
                            claursen Level 1

                            Thanks for your help Resdesign! Sorry for my delayed response.

                             

                            I figure it out. Only the variables in the stage are global. Variables in symbols are only local. 

                            So the solution is to put global variables in the main stage.

                             

                            Example: (In the stage)

                            sym.setVariable("startglobal", "NAME");

                             

                            Then in a symbol, get variable from the stage and make a local variable from it.

                            var whatname = sym.getComposition().getStage().getVariable("startglobal");

                             

                            You can then also change/set the variable in the stage from the symbol.

                            sym.getComposition().getStage().setVariable("startglobal", "NEWNAME")