12 Replies Latest reply on Dec 15, 2014 8:59 PM by Henry Code

    Reset button

    Aiesyaah

      Hi,

       

      How do you do the reset button in Adobe Edge? What are the set of codes used? On reset, I have to stop an animation and the animation will play again from start. In other words, how do I clear the previous animation so that the animation will play again from start?

       

      Thank you.

        • 1. Re: Reset button
          dhosford Employee Moderator

          Hi there,

           

            It depends on whether your animation is in a symbol or on a stage, but if you put this code in the click function of your reset button:

           

          sym.play("start");

           

            And then put a label at the beginning of your animation and name it "start" (no quotation marks). It will reset the animation during it's playing and start from the beginning.

           

          Let me know if you need further clarification. I hope this helps!

          1 person found this helpful
          • 2. Re: Reset button
            dhosford Employee Moderator

            Also, here is a link to a sample file I made, in case you'd like to take a look at it further. Just click the Reset Button image below to download the link.

             

            reset.png

            https://creative.adobe.com/share/45a94b2f-0d3d-4199-86a7-b2661c768aa9

            1 person found this helpful
            • 3. Re: Reset button
              Aiesyaah Level 1

              Hi dhosford,

               

              My animation is in a symbol which i place on the stage. I've tried the method you suggested, but it doesn't work the way I want it to be.

              Right now, it just pauses the current (bait) animation and continue playing when the current bait is clicked on again.

              Basically i want the animation (worm, shrimp, shoe and big fish) to go to the moment where it drops from the fishing hook.

               

              This is the link to my file. https://www.box.com/s/vy336lfujjy3ccespacl

               

              Thank you.

              • 4. Re: Reset button
                elainecc Adobe Employee

                HI, Aiesyaah-

                 

                You can do the same thing that dhosford has done by calling the symbol's play action like this:

                 

                sym.getSymbol("mySymbolInstanceName").play(0);

                 

                This code snippet will play your symbol instance (the name that's displayed in the Elements Panel) from the beginning.  The code snippet would go into your button's click handler.

                 

                Hope this helps,

                 

                -Elaine

                • 5. Re: Reset button
                  dhosford Employee Moderator

                  My apologies for not getting back to this thread sooner. Elaine is absolutely correct! I've also edited the sample file I originally made with a new version to show how to do this with your animation contained in a symbol.

                   

                  Also, just to point out: the "0" in Elaine's code snippet is referencing a timecode of 0, which is the beginning. You can change this timecode to another number to reference other points in the timeline (for instance, 1000 = 1 second, 1500 = 1.5 seconds, etc) or use the label method I demonstrated previously. It's all personal preference. I like labels. : )

                   

                  Just click the image below for the download to start.

                  reset.png

                  https://creative.adobe.com/share/071d2595-0b77-4ccd-9cb9-87e87c9d40b9

                  1 person found this helpful
                  • 6. Re: Reset button
                    Aiesyaah Level 1

                    Hi dhosford,

                     

                    I can't download it. I'll try out both your method and Elaine's.

                     

                    Thank you both for your time. 

                    • 7. Re: Reset button
                      Aiesyaah Level 1

                      Thank you dhosford!

                       

                      I got the reset button to work.

                      • 8. Re: Reset button
                        dhosford Employee Moderator

                        Hi Aiesyaah,

                         

                          I relinked the file. It should be working now. Let me know if you still have trouble downloading it.

                         

                        Thanks!

                        • 9. Re: Reset button
                          Aiesyaah Level 1

                          Thank you elainefinnell!

                           

                          I got the reset button to work.

                          • 10. Re: Reset button
                            Aiesyaah Level 1

                            Thank you so much dhosford!

                            I really appreciate your help

                            • 11. Re: Reset button
                              elainecc Adobe Employee

                              Awesome, great to hear!

                              • 12. Re: Reset button
                                Henry Code Level 1

                                OK guys,

                                 

                                If im at a stop trigger on the timeline EX:   sym.stop(1000);

                                Then I'm animating a click function on a div/element EX:

                                 

                                sym.$("Rectangle2Copy23").animate({left:'3px',height:'77'});

                                 

                                How do I reset the button incase they click again to create the same effect?

                                Instead the object does nothing since it is already in position.

                                I would like it to go back to its original position and recreate the same effect.

                                Problem is the timeline is stopped…even if i go to another point in the timeline

                                the last position assigned by the effect remains, I would like it to reset it even on the same point on the timeline…

                                 

                                 

                                Thanks ,