# How do I make a clip move to a different location?

**URL:** <https://forum.kirupa.com/t/how-do-i-make-a-clip-move-to-a-different-location/10677>\
**Category:** flash\
**Created:** [January 5, 2003, 3:25pm UTC](https://forum.kirupa.com/t/how-do-i-make-a-clip-move-to-a-different-location/10677 "2003-01-05T15:25:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKEEN](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@SKEEN](https://forum.kirupa.com/u/SKEEN)\
**Post date:** [January 5, 2003, 3:25pm UTC](https://forum.kirupa.com/t/how-do-i-make-a-clip-move-to-a-different-location/10677/1 "2003-01-05T15:25:29Z")

</div>

Hey every one, This is my first tread, but Im a long time viewer of this site.I ve got a question. Im trying to figure out how to move a clip from one location to another using a button. This is the code on my movie clip.

onClipEvent (load) {  
\_root.targX=100;;  
}  
onClipEvent (enterFrame) {  
myX = this.\_x;  
difX = myX-\_root.targX;  
setProperty (this, \_x, myX-(difX/25));  
}

This is the code on my button.

on (release) {  
\_root.targX = 600;

}  
After the movie clip has move to its new \_x location(600). How do I move the clip along its \_y axis or any specific loction w/o having to use the random() method.  
Got any clues. everyones help is much appreciated. Im using Flash 5.  
SKEEN

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 5, 2003, 3:30pm UTC](https://forum.kirupa.com/t/how-do-i-make-a-clip-move-to-a-different-location/10677/2 "2003-01-05T15:30:53Z")

</div>

welcome :beam:

allow me to send you in the direction of  
“Object move wgen clicking a button”  
[http://www.kirupaforum.com/showthread.php?s=&threadid=10275](http://www.kirupaforum.com/showthread.php?s=&threadid=10275)

same basic concept

but I will point out that in  
\_root.targX = 600;  
if (\_root.targX==600) {  
\_root.targX.\_y=100;  
}

you are making targX = 600; then checking to see if it is 600, and if so making targX.\_y = 100. Well of course targX is going to be 600 if you set it to be 600 the line before. The if has no purpose since its always true :\

😉
