# Help with moing with mouse!

**URL:** <https://forum.kirupa.com/t/help-with-moing-with-mouse/256044>\
**Category:** programming\
**Created:** [March 29, 2008, 7:46pm UTC](https://forum.kirupa.com/t/help-with-moing-with-mouse/256044 "2008-03-29T19:46:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![haphadon](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@haphadon](https://forum.kirupa.com/u/haphadon)\
**Post date:** [March 29, 2008, 7:46pm UTC](https://forum.kirupa.com/t/help-with-moing-with-mouse/256044/1 "2008-03-29T19:46:42Z")

</div>

Ok I need help with something to do with mouse clicks. I want my character (Movieclip) to move where my mouse clicks.  
Code:

```auto
onClipEvent (mouseDown) {
 endX = _root._xmouse;
 endY = _root._ymouse;
}
onClipEvent (enterFrame) {
 _x += (endX-_x)/speed;
 _y += (endY-_y)/speed;
}

```

But when ever I click somewhere my character will act as if there is no friction so it starts fast slows down and goes past my click! What is worng?  
I also would like to know how to make that object stop when it hits a certain object but cant do it can anyone help me?
