-
stopDrag?
here's the deal. i have a nav menu inside an mc. in the nav, i want something to follow the mouse. right now, i have a box that basically hovers over the nav choices. makeing an invisible button inside the nav mc, i can use startDrag on rollover to get the slider moving. unfortunately once that happens, it never leaves the mouse alone. it still stays within the bounds of the rectangle i defined (the nav mc), but i cannot get it to stop when i rollout. how can i get this? is there a better way? i know i've seen this done before, and think i've even seen a tutorial on it, but can't find it now.
-
Assuming the navigation instance name is "nav" and the slider's is "slide".
Attach this code to slide:
Code:
onClipEvent (mouseMove) {
if (hitTest(_root._xmouse, _root._ymouse, false)) {
} else {
this.stopDrag();
}
}
Your startDrag event will confine it to the nav area and when you mouse out of it, the slide cannot follow the mouse and the hitTest will become false, thus stopping the drag. Another way you could do it would be to capture the mouse's coordinates. _root._ymouse and _root._xmouse and compare them to the nav's coordinates. Once the mouse left the bounds you could trigger the stopDrag.
-
that is perfect. thank you.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|