# autoMoveObject to (x,y) coordinates instead of randomly

**URL:** <https://forum.kirupa.com/t/automoveobject-to-x-y-coordinates-instead-of-randomly/289393>\
**Category:** flash\
**Created:** [May 29, 2009, 6:52pm UTC](https://forum.kirupa.com/t/automoveobject-to-x-y-coordinates-instead-of-randomly/289393 "2009-05-29T18:52:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![almaline03](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@almaline03](https://forum.kirupa.com/u/almaline03)\
**Post date:** [May 29, 2009, 6:52pm UTC](https://forum.kirupa.com/t/automoveobject-to-x-y-coordinates-instead-of-randomly/289393/1 "2009-05-29T18:52:23Z")

</div>

:cop:I have this function that moves the cursor automatically to random points. I want to know how I can make them move to 4 specific points (x,y coordinates) instead.

I am assuming I need to create an array of the of some sort with the x,y points and tween them but have no idea how to go about this.

```auto

function autoMoveObject() {
	if (!mouseControl) {
 		var moveObjectX:Tween = new Tween(cursor, "_x", Regular.easeOut, cursor._x, Math.random() * Stage.width, 1, true);
		var moveObjectY:Tween = new Tween(cursor, "_y", Regular.easeOut, cursor._y, Math.random() * Stage.height, 1, true);
		moveObjectX.onMotionFinished = function() {
			autoMoveObject();
		};
	}
}

```
