I've got an MC that follows my cursor, but it follows it for everywhere that my cursor is on the page. I want to to only follow my cursor if it is in a specified area. (I'm making a horizontal nav bar (2 rows, bottom row is submenu) and I only want it to follow while the cursor is over the top of the root menu (the one on top). Here is the code that I have so far.
onClipEvent (enterFrame) {
//x movement
mx=_root._xmouse-50;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/2;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
}
I'm using Flash MX2004. I just don't know enough about how to specify the boundries. Thanks.
Here's something I just knocked together quickly that might help.
Uses the mouse following code from here: http://actionscript.org/tutorials/ad...se/index.shtml
so visit there for an explanation of the movement code, I just added the if statement for the coordinates of the box.