# Easing + random

**URL:** https://forum.kirupa.com/t/easing-random/44532
**Category:** flash
**Created:** [March 4, 2004, 7:05pm UTC](https://forum.kirupa.com/t/easing-random/44532 "2004-03-04T19:05:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kokoi](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@kokoi](https://forum.kirupa.com/u/kokoi)
#### Post date: [March 4, 2004, 7:05pm UTC](https://forum.kirupa.com/t/easing-random/44532/1 "2004-03-04T19:05:15Z")

</div>

I’m trying to create a dot that moves with easing towards a randomized point. The randomization works. But the dot isn’t moving with easing it just “hops” from the one point to the other.  
I used this script but I believe it has a mistake hidden in it.

[AS]onClipEvent (load) {  
speed = 5;  
}  
onClipEvent (enterFrame) {  
this.\_x = \_x+(endX-\_x)/speed;  
this.\_y = \_y+(endY-\_y)/speed;  
if (endX=this.\_x) {  
if (endY=this.\_y) {  
endX = Math.floor(Math.random()_(550-0)+0);  
endY = Math.floor(Math.random()_(400-0)+0);  
}  
}  
}  
[/AS]

Could someone help me?  
Thnx in advance
