1 Reply Latest reply on May 12, 2008 7:35 AM by kglad

    Actionscript Tweening stuck in mouseover position

    sandisi
      Here is my code for rollOver() and rollOut(). This code is applied to a small movieclip that moves the movieclip up 10 pixels on mouseover and back down on mouseout. It also gives the movieclip the elastic effect. Sometimes when I rollover the movieclip when viewing the swf, it gets stuck in the mouseover position when I have already rolled out. Any idea why it does this?

      on (rollOver) {
      var adobe = _level0.controls.Dock.graphics.adobe;
      var adobereflect = _level0.controls.Dock.graphics.adobereflect;
      var adobetxt = _level0.controls.Dock.graphics.adobetxt;
      import mx.transitions.Tween;
      import mx.transitions.easing.*;

      var Tweenadobe1:Tween = new Tween(adobe, "_y", Elastic.easeOut, 27, 12, 15, false);
      var Tweenadobe2:Tween = new Tween(adobereflect, "_y", Elastic.easeOut, 55, 65, 15, false);
      var Tweenadobe3:Tween = new Tween(adobetxt, "_alpha", None, 100, 0, 30, false);
      Tweenadobe1.onMotionFinished = function() {
      Tweenadobe1.stop();
      };
      Tweenadobe2.onMotionFinished = function() {
      Tweenadobe2.stop();
      };
      Tweenadobe3.onMotionFinished = function() {
      Tweenadobe3.stop();
      };
      }

      on (rollOut) {
      var adobe = _level0.controls.Dock.graphics.adobe;
      var adobereflect = _level0.controls.Dock.graphics.adobereflect;
      var adobetxt = _level0.controls.Dock.graphics.adobetxt;

      var Tweenadobe4:Tween = new Tween(adobe, "_y", Elastic.easeOut, 12, 27, 15, false);
      var Tweenadobe5:Tween = new Tween(adobereflect, "_y", Elastic.easeOut, 65, 55, 15, false);
      var Tweenadobe6:Tween = new Tween(adobetxt, "_alpha", None, 0, 100, 30, false);
      Tweenadobe4.onMotionFinished = function() {
      Tweenadobe4.stop();
      };
      Tweenadobe5.onMotionFinished = function() {
      Tweenadobe5.stop();
      };
      Tweenadobe6.onMotionFinished = function() {
      Tweenadobe6.stop();
      };
      }