buddylee
February 25th, 2003, 10:06 PM
Ok, this should be simple for you guys. Here is what I am trying to do:
I have this box which is a MC and it is called "orangebox".
Now I want this box to follow my mouse, but only over a certain region. I put a rectanlge MC over the area I want the box to follow. On that rectange I put this code...
on (rollOver) {
startDrag("_root.orangebox", true, 60, 362, 742, 362);
}
That works fine and dandy, but I want it to ease when it follows, not stay on the mouse. I think it will give it a cooler look. The code Kirupa has for ease is...
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
I need to get these two codes together. Any takers?
I have this box which is a MC and it is called "orangebox".
Now I want this box to follow my mouse, but only over a certain region. I put a rectanlge MC over the area I want the box to follow. On that rectange I put this code...
on (rollOver) {
startDrag("_root.orangebox", true, 60, 362, 742, 362);
}
That works fine and dandy, but I want it to ease when it follows, not stay on the mouse. I think it will give it a cooler look. The code Kirupa has for ease is...
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
I need to get these two codes together. Any takers?