3 Replies Latest reply on Feb 2, 2013 9:45 PM by tmacka_88

    sym.stop() if statement?

    tmacka_88 Level 1



      Im adding a sym.stop() to mouseover within my project but my problem is that if I hover over the field in between the new slide animation it stops there.


      I want it to only stop between certain times within my timeline. I understand that i have to use if statements but I have never done this before and am having a little trouble with it.


      my first animation is between 8000-8750 on the time line so therefore do not want the sym.stop() to work within this period.


      How should I go about doing this?




        • 1. Re: sym.stop() if statement?
          ♥Schrene Level 4

          If you could post your files it would be easier to help you.

          It may be a simple fix??



          In order to make an else if statement work you need to have a condition happen that triggers your action.

          I have used z-index of an element in my animation to manipulate an else if statement.

          Changing the z-index of an object can never bee seen unless the object is layered with another object.

          So pick an object that is on the top layer and is to remain there.

          Let's say you have a button on the Stage you could use this as your z-index target..


          You would put this code in the timeline where you wanted your stop action to happen:

          sym.$("button").css("z-index", "5");


          Then your else if would look something like this:


          var theIndex = sym.$("button").css("z-index");


          if ( theIndex == "5") {



          else {



          • 2. Re: sym.stop() if statement?
            tmacka_88 Level 1



            yes here are my files:


            basically my variable will be with the timeline. as you will see in the main time line I have animations that slide in a new symbol (pages). I want to use if statements that allows the animation to stop using mouseover but only stops the timeline outside the animations that occur between 8-8.75s, 16.75-17.5s, 25.5-26.25s, 34.25-35 and 40-40.75s.



            • 3. Re: sym.stop() if statement?
              tmacka_88 Level 1

              figured it out



              for mouseover



              if ((sym.getPosition()>=0) && (sym.getPosition()<=8000)) {sym.stop();}

              if ((sym.getPosition()>=8750) && (sym.getPosition()<=16750)) {sym.stop();}

              if ((sym.getPosition()>=17500) && (sym.getPosition()<=25500)) {sym.stop();}

              if ((sym.getPosition()>=26250) && (sym.getPosition()<=34250)) {sym.stop();}

              if ((sym.getPosition()>=35000) && (sym.getPosition()<=40000)) {sym.stop();}


              and mouseout