Not sure how to explain this, but I have a horizontal menu, and a small image above it that follows the mouse, within it’s set boundaries. The only thing I have trouble with is getting it to stop right above the button when it’s clicked, and wait for the user to move over the navigation menu again before it starts following the mouse… So, when a user clicks on a button, the image should stick there.
I had the idea to have a transparent area above the nav that would detect for the mouse? Because right now, your mouse can be anywhere on the page, and this image scrolls right or left…
Any ideas how to set that up?
Here is the code I have on my image mc (called ‘niteLite’)… it’s in the root (my navigation is in another mc though - couldn’t get the mouse follower to work right within another mc, unfortunately)…
on niteLite (image mc)
onClipEvent (load) {
_x = 347;
_y = 497;
speed = 2;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
//endY = _root._ymouse;
_x += (endX-_x)/speed;
//_y += (endY-_y)/speed;
startDrag("follow",true);
if (_root.niteLite._x < 347) {
_root.niteLite._x = 347;
}
if (_root.niteLite._x > 727) {
_root.niteLite._x = 727;
}
}
Thanks for any help you can offer.