1 Reply Latest reply on Aug 27, 2013 2:42 AM by kglad

    Can't Stop a tween?

    JonnyDL Level 1

      I created something interesting (by accident)[interesting because I hadn't done it yet],  now I'm trying to  understand it, and controll it, and was hoping for some insite. I was looking for a way for an item to drop and have some rotation while setteling off a bounce. Well I go it (or at least really close). The trouble I'm having is getting it (the rotation) to stop).

       

      When it reaches a point it (off the bounce) it activates the rotaion to make it look more real. I'm having a problem, being able to stop the rotation when it settles from the bounce ease. It will settle off the bounce and then continue and finish the rotation.

       

      here is what I got

       

      var falling:Tween = new Tween (Ductwork,"_y",Bounce.easeOut,Ductwork._y,425,4,true);

       

       

      falling.onMotionChanged = function ()

      {

                onEnterFrame = function ()

                {

                          falling.onMotionFinished = function ()

                          {

                          delete onEnterFrame

                          trace("stop");

                          myrotation.stop();

                          }

       

       

                          if (Ductwork._y > 410 && Ductwork._y < 420)

                          {

                          delete onEnterFrame

                          var myrotation:Tween = new Tween (Ductwork,"_rotation",Regular.easeOut,0,16,4,true);

       

                          }

       

                }

      }

       

      Can anybody see how to stop the rotation (at the end of the bounce.

      If someone has a bettter way/better animation please let me know

       

        Thanks