# Random movement idea / question

**URL:** https://forum.kirupa.com/t/random-movement-idea-question/121562
**Category:** Uncategorized
**Created:** [September 3, 2004, 10:45pm UTC](https://forum.kirupa.com/t/random-movement-idea-question/121562 "2004-09-03T22:45:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Casenote](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Casenote](https://forum.kirupa.com/u/Casenote)
#### Post date: [September 3, 2004, 10:45pm UTC](https://forum.kirupa.com/t/random-movement-idea-question/121562/1 "2004-09-03T22:45:51Z")

</div>

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

```auto

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) 😊

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
