# Follow cursor problem looking for an answer

**URL:** <https://forum.kirupa.com/t/follow-cursor-problem-looking-for-an-answer/293500>\
**Category:** Uncategorized\
**Created:** [July 30, 2009, 12:20am UTC](https://forum.kirupa.com/t/follow-cursor-problem-looking-for-an-answer/293500 "2009-07-30T00:20:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h\_town](https://avatars.discourse-cdn.com/v4/letter/h/c77e96/32.png) [@h\_town](https://forum.kirupa.com/u/h_town)\
**Post date:** [July 30, 2009, 12:20am UTC](https://forum.kirupa.com/t/follow-cursor-problem-looking-for-an-answer/293500/1 "2009-07-30T00:20:24Z")

</div>

I’m halfway to where I need to be but am clearly missing a piece.

Ultimately I need have a cursor that flips horizontally (or preferably one where I can change the image to an alternate) while moving in a rightward or leftward direction. The arrow goes to the right when moving right, left when moving left not up, down or any other angle.

So far so good but the y-axis is now dead.

I have a basic concept test setup at [http://tinyurl.com/luvf3h](http://tinyurl.com/luvf3h)

and here is the basic borrowed cursor code.

Any ideas on being able to move the cursor along the y-axis while keeping the arrow pointing left or right?

cursor\_mc.onEnterFrame = function() {  
var xMouse = \_xmouse;  
if (Math.abs(xMouse-this.\_x)\<1) {  
this.\_x = xMouse;  
} else {  
this.\_x -= (this.\_x-xMouse)/6;  
}  
var nX = xMouse-pX;  
if (nX\>0) {  
this.\_xscale = 100;  
} else if (nX\<0) {  
this.\_xscale = -100;  
}  
pX = xMouse;  
};
