# I have a function that makes an MC hover....now how do I turn it off?

**URL:** <https://forum.kirupa.com/t/i-have-a-function-that-makes-an-mc-hover-now-how-do-i-turn-it-off/210553>\
**Category:** flash\
**Created:** [December 19, 2006, 10:59pm UTC](https://forum.kirupa.com/t/i-have-a-function-that-makes-an-mc-hover-now-how-do-i-turn-it-off/210553 "2006-12-19T22:59:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtrace](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@dtrace](https://forum.kirupa.com/u/dtrace)\
**Post date:** [December 19, 2006, 10:59pm UTC](https://forum.kirupa.com/t/i-have-a-function-that-makes-an-mc-hover-now-how-do-i-turn-it-off/210553/1 "2006-12-19T22:59:52Z")

</div>

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?  
Thanks.  
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);
