[F8] Mouse position with function (.fla file attached)

Hey there,

I’ve got a button called ‘HitArea’ and I’ve got some code (tween class) that when you roll over the ‘HitArea’ a small ball ‘ball_mc’ goes to the mouse position, x and y.


import mx.transitions.Tween; 
import mx.transitions.easing.*; 
 
HitArea.onRollOver = function() {   
    var gotoX = new Tween(ball_mc, "_x", Regular.easeOut, 20, _root._xmouse, 2, true); 
    var gotoy = new Tween(ball_mc, "_y", Regular.easeOut, 20, _root._ymouse, 2, true); 
} 

But it only goes to the initial place that the mouse rolls over the ‘HitArea’

I want the ‘ball_mc’ to go to the mouse position when it rolls over ‘HitArea’ then the ‘ball_mc’ would also follow the mouse around inside the ‘HitArea’

Any help would be great please