17 Replies Latest reply on Jan 8, 2007 4:26 PM by luis_mendoza_jr

    I have a function that tells a movie clip to hover around, how do i turn it off though?

      Basically, I have a function that is telling this piece of text to move around. When someone rolls over the text however, I'd like for this function to stop. And when someone rolls off of the text, I want it to continue.

      How can I do this?


      function floatMc(float_mc:MovieClip, range_num:Number, frames_num:Number):Void {
      var xMin:Number = float_mc._x-range_num;
      var xMax:Number = float_mc._x+range_num;
      var yMin:Number = float_mc._y-range_num;
      var yMax:Number = float_mc._y+range_num;
      var frames:Number = frames_num;
      //number of seconds for the tween to take, and how often to start a new tween
      var me:MovieClip = float_mc;
      function newTween() {
      //adjust the easing class as needed
      var xNew:Number = (Math.random()*(xMax-xMin))+xMin;
      var yNew:Number = (Math.random()*(yMax-yMin))+yMin;
      xTween = new mx.transitions.Tween(me, "_x", mx.transitions.easing.Regular.easeInOut, me._x, xNew, frames, false);
      yTween = new mx.transitions.Tween(me, "_y", mx.transitions.easing.Regular.easeInOut, me._y, yNew, frames, false);
      var IntID:Number = setInterval(newTween, (frames*(1000/31)));
      floatMc(penthouse, 12, 62);