Random movement idea / question

Ok I need some major help do to my major lacking in actionscripting.
:upset:

I want to have a MC that is going to work as a button.

ok, now having said that…I want it to be constantly moving in (doing a little jitter) in a confined space lets say a 65px by 65px space. BUT when some one puts there mouse over the MC I want it to stop moving (jittering) and play forward its rollover animation.

Currently I have this set on the button


onClipEvent(enterFrame){
        if (this.hitTest(_root._xmouse, _root._ymouse, true)){
                this.nextFrame();
        } else {
                this.prevFrame();
        }
}

Obviously this is to play the animation forward when a mouse is over top. (Don’t get me wrong, I didn’t figure that out by myself) :blush:

What would I add for the motion. It can be actually random…or it can be fixed…(i would rather it be random)

Ideally I would also like to have the MC follow the mouse pointer until it leaves the 65px by 65px square, and then go back to moving (jittering)

Case