# Moving object to a certain position

**URL:** <https://forum.kirupa.com/t/moving-object-to-a-certain-position/280985>\
**Category:** Uncategorized\
**Created:** [February 3, 2009, 6:38pm UTC](https://forum.kirupa.com/t/moving-object-to-a-certain-position/280985 "2009-02-03T18:38:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gencoglu](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gencoglu](https://forum.kirupa.com/u/gencoglu)\
**Post date:** [February 3, 2009, 6:38pm UTC](https://forum.kirupa.com/t/moving-object-to-a-certain-position/280985/1 "2009-02-03T18:38:43Z")

</div>

hi,  
The following code works fine when mouse is pressed at any position on the screen ,object moves that position…but what if I want the object move that position at a certain speed…say+10 using setInterval…I mean I want my object move slowly to any position I click on the screen…  
How do you modify the code ?  
thanks  
[COLOR=#000000][FONT=Courier New][COLOR=#0000bb]onClipEvent [/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]mouseDown[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {  
[/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]\_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_xmouse[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]\_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_ymouse[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];  
} [/FONT]  
[/COLOR][COLOR=#0000bb][/COLOR][/COLOR]
