# Movement with actionscript

**URL:** https://forum.kirupa.com/t/movement-with-actionscript/58059
**Category:** Uncategorized
**Created:** [July 19, 2004, 1:54pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059 "2004-07-19T13:54:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Gumby19](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gumby19](https://forum.kirupa.com/u/Gumby19)
#### Post date: [July 19, 2004, 1:54pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059/1 "2004-07-19T13:54:25Z")

</div>

I have a floating menu on my page that the viewer can drag around the screen. I need to have the viewer be able to click on it and it move to a certain spot on the screen from where it was. I can make it go to a certain point by setting the \_x and \_y values of it, but I want to be able to see the motion of it going to that point, instead of just appearing there. Hope I explained clearly. Thanks.

---

<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: [July 19, 2004, 4:03pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059/2 "2004-07-19T16:03:32Z")

</div>

so say your menu is an MC w/instance name menu, it’s AS:

```auto
onClipEvent (load){
	speed = 5;
	destinationx = 100;
	destinationy = 20; // (100,20) is the start location

}
onClipEvent (enterFrame) {
	x = destinationx-_x;
	this._x += x/speed;
	y = destinationy-_y;
	this._y += y/speed;
}

```

AS for button inside menu mc:

```auto
on (release){
	_parent.menu.destinationx = 300; // (300,400) is where you want the menu to go when clicked.
	_parent.menu.destinationy = 400;
}

```

---

<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: [July 19, 2004, 4:20pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059/3 "2004-07-19T16:20:59Z")

</div>

Sweet, thanks bwh2!

---

<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: [July 19, 2004, 4:32pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059/4 "2004-07-19T16:32:42Z")

</div>

you’re welcome.

---

<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: [July 19, 2004, 6:07pm UTC](https://forum.kirupa.com/t/movement-with-actionscript/58059/5 "2004-07-19T18:07:34Z")

</div>

gumby, u know there is a tutorial section on this site right? the movement is called easing 😉

Prophet.
