1 Reply Latest reply on Apr 27, 2009 5:29 PM by kglad

    mouse follower

    alexManuelSilva

      I am trying to write code for a horizontal mouse follower.

      I came up with  this:

       

      import fl.transitions.*;
      import fl.transitions.easing.*

       

      this.addEventListener (Event.ENTER_FRAME, MF);

      function MF (e:Event):void{

      var PF:int = movingBar.x;
      var MyTween:Tween = new Tween(movingBar, "x", Strong.easeOut, PF, mouseX, 2, true);

       


      I can´t figure out why it doesn´t work.

      The movingBar moves a few pixels to the left and then it gets stuck.

      This code has worked before.

      Can anyone help?

      Thanks

      Alex