Search  

OBJECT FOLLOW CURSOR ROTATION FLIPPING PROBLEM

HomeForumsFlash DiscussionObject Follow Cursor Rotation flipping problem
12725 squarepig
10 posts
Bought between 10 and 49 items

Can anyone help me sort out a flip problem with an mc clip that follows the mouse and rotates towards the movement but flips awkwardly when you move the mouse again. here is the code

//Place this on the mc

onClipEvent (load) { //_x = 0; //_y = 0; speed = 6; area = 0; } onClipEvent (enterFrame) {

//attach mc to the pointer if mouse over the area if (area == 0) { this.play(); endX = _root._xmouse; endY = _root._ymouse; _x += (endX-_x)/speed; _y += (endY-_y)/speed;

//rotate MC to follow the mouse angle this.onMouseMove = function() { _rotation = (Math.atan2(_root._ymouse-_y, _root._xmouse-_x))*(180/Math.PI); ease = 3; }; } }

I’m a bit of a novice so I’m hoping it’s a line missing or so. I don’t know how to set up new functions.

Any help much appreciated.

Posted about 1 month ago
64828 LGLab
186 posts
Exclusive author Referred at least one person Sold between 1 000 and 5 000 dollars Bought between 10 and 49 items

Do you have a link to an example of what you have so far?

Posted about 1 month ago
12725 squarepig
10 posts
Bought between 10 and 49 items
68063 Emroni
363 posts
Exclusive author Item was featured Referred at least one person Sold between 1 000 and 5 000 dollars Bought between 1 and 9 items

The code basically says this:

when mouse moves to the right, follow it untill underneath. when mouse moves to the left, follow it untill on top of mouse. So when you go left then right, it flips over. I think you need to rewrite your code, so it doesnt do the left/right thing

Posted about 1 month ago
12725 squarepig
10 posts
Bought between 10 and 49 items

I think you’re right. Only trouble is I don’t know how. I am hoping someone has a function code which will slot into the existing code and solve the problem…

Posted about 1 month ago