10 Replies Latest reply on Oct 30, 2013 8:54 AM by Gygex

    playReverse delay issues?

    Gygex

      Can someone just tell me how to write a delay properly. I can't find the right code. I want to playReverse an element, have a delay, then hide that element and show another. You see the code is like:

       

      sym.getSymbol("Animation").playReverse()

      sym.getSymbol("Animation").hide()

      sym.getSymbol("nextElement").show()

       

      Only issue is that I can't get the playReverse() to work because it all gets executed at th same time. I need a delay somewhere, but I dont know, my head is not seeing it right now, I've been staring at it too much lol.

       

      So any help would be nice to save me here.

       

      Thanks in advance.

        • 1. Re: playReverse delay issues?
          resdesign Adobe Community Professional & MVP

          To hide you need to use

          sym.$("Animation").hide()

          sym.$("nextElement").show()

          • 2. Re: playReverse delay issues?
            Gygex Level 1

            I am saying that, and I can hide it (saying getSymbol("element") references a symbol outside of "this" element, so that it can manipulate other elements other than its own. So its the same.) But my question is that I need to use the playReverse() for my animation before it hides itself and shows the next. But it executes all at the same time so the playReverse() animation never gets called really because its hidden just at the same time. So I need a delay, most likely the same length of the playReverse() animation (which is literally only 0:00.155 seconds) before it gets hidden.

            • 3. Re: playReverse delay issues?
              resdesign Adobe Community Professional & MVP

              Try this maybe:

               

              var rectangle = sym.$('Symbol_1');

               

              sym.getSymbol('Symbol_1').play();

              rectangle.click(function(){

                        sym.getSymbol('Symbol_1').playReverse();

                        sym.$('Symbol_1').animate({"opacity": 0},2000);

                        sym.getSymbol('Symbol_2').play();

              });

              • 4. Re: playReverse delay issues?
                Gygex Level 1

                Ehm... I see where you're coming from, but the second Symbol isn't to be played just to be shown. Also the animate trigger looks nice, good to know, but the first Symbol can't animate opacity over its time cause the animation includes it and just doesn't work. I need a proper "delay" command. I've seen this:

                 

                sym.$("AnimationOne").delay(500).hide(100);

                 

                But its just ignoring the delay command. I dont know, is this how its to be written? Is there a better way?

                 

                Edit: Also the first Symbol needs to be hidden, it can't just look like its not there because the Symbol underneath that gets shown afterwards has rollover animations too, so that first Symbol needs to be gone.

                • 5. Re: playReverse delay issues?
                  resdesign Adobe Community Professional & MVP

                  A possible way would be to have the hide command at 0 in the symbol's timeline (to hide itself) and the play at let's say 100 mls to play it so it would not hide on play but only on playReverse()

                  So basically when it plays it does not see the hide() because it starts at 100mls on a label but when it plays playReverse() since it goes to 0 it will see the hide command and hide.

                  Not pretty but should work.

                   

                  I am sure some smarter person than me will show you a better way.

                  • 6. Re: playReverse delay issues?
                    Gygex Level 1

                    I dont know why this was even difficult to find in the first place but I found the answer. Its called the setTimeout() method. Link describing it found below:

                     

                    http://www.w3schools.com/js/js_timing.asp

                     

                    I'm sure a lot of people who read this will be like "duh!", but I didn't know and its NOT on the forums as I've checked over and over. So here it is for all to see.

                    • 7. Re: playReverse delay issues?
                      resdesign Adobe Community Professional & MVP

                      Like you said duh! I forgot about that!

                      • 8. Re: playReverse delay issues?
                        Gygex Level 1

                        Its ok I found the answer and posted below, thank you for trying though, seems you were the only attempting to help, so for that I appreciate it

                        • 9. Re: playReverse delay issues?
                          resdesign Adobe Community Professional & MVP

                          Well there is not much activity on the forum but I keep an eye on the questions. Good luck on your project.

                          • 10. Re: playReverse delay issues?
                            Gygex Level 1

                            Thank you so much