# Follow mouse stop on rollover the object

**URL:** https://forum.kirupa.com/t/follow-mouse-stop-on-rollover-the-object/317825
**Category:** Uncategorized
**Created:** [January 4, 2011, 7:43am UTC](https://forum.kirupa.com/t/follow-mouse-stop-on-rollover-the-object/317825 "2011-01-04T07:43:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![prettina](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@prettina](https://forum.kirupa.com/u/prettina)
#### Post date: [January 4, 2011, 7:43am UTC](https://forum.kirupa.com/t/follow-mouse-stop-on-rollover-the-object/317825/1 "2011-01-04T07:43:17Z")

</div>

hi all,

i am trying to make flash for website where many smileys are there on the screen and they follow the mouse at varying speed.now when i rollover to any smiley it should display a speech bubble with dynamic text…the problem is in the rollover…it does not stop there but keeps moving so speech bubble disappears very fast.im attaching the fla.please have a look at it and help me

i put following code on the smiley

onClipEvent (load) {  
speed = 15;  
}  
onClipEvent (enterFrame) {  
endX = \_root.\_xmouse-12;  
endY = \_root.\_ymouse+20;  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
onRollOver = function () {  
attachMovie(“word”, “word1”, \_root.getNextHighestDepth());  
word1.\_x = \_xmouse +3;  
word1.\_y = \_ymouse -80;  
};  
onRollOut = function () {  
removeMovieClip(“word1”);  
};

}
