# Random Motion - How To Stop It?!

**URL:** https://forum.kirupa.com/t/random-motion-how-to-stop-it/168848
**Category:** flash
**Created:** [November 10, 2005, 4:13pm UTC](https://forum.kirupa.com/t/random-motion-how-to-stop-it/168848 "2005-11-10T16:13:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thedaveyb](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@thedaveyb](https://forum.kirupa.com/u/thedaveyb)
#### Post date: [November 10, 2005, 4:13pm UTC](https://forum.kirupa.com/t/random-motion-how-to-stop-it/168848/1 "2005-11-10T16:13:36Z")

</div>

hey, im creating a menu for a full flash site. The menu uses random motion that is placed on the moveclip (button).

The random motion part works great and becuase im not dynamically duplicating clips can target them individually.

What i cant seem to make work is when the user hovers over the Movieclip (button) i would like the random motion to stop/pause for the amount of time the user ‘mouseover’s’ the button.

The random motion script i am using is

onClipEvent (load) {  
var radius = 10 + Math.random() \* 50;  
var speed = 1 + Math.random() \* 10;

```
var xcenter = this._x;

var ycenter = this._y;

var degree = 0;
var radian;

```

}  
onClipEvent (enterFrame) {  
degree += speed;  
radian = (degree/180)\*Math.PI;  
this.\_x = xcenter+Math.cos(radian)\*radius;  
this.\_y = ycenter-Math.sin(radian)\*radius;  
}
