flash mouse follower....
- Started
- Last post
- 9 Responses
- Dno
Afternoon all,
I am hoping that one of the flashers on here can tell me what I need to add to this script please, it is for a mouse follow thing and is pasted onto the mc that is to act as the follower.
What I want it to do is to respond to the x co-ordinate of the mouse so if the mouse moves to the left then it shows the mc pointing left and if the mouse goes right the mc points right - at present it simply follows the mouse and doesn't change if the mouse is to the left or right.
This is my code:
Code:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}how do I make it flip as mentioned above???
Be grateful for any pointers folks
:)
- SirG0
Easy as that:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
if (endX
- SirG0
Hmm... can't seem to use smaller than sign... So I'll write it in plain English
if (endX isSmallerThan _x){
//going left
} else {
// going right
}
- Dno0
thanks for the reply sirG - can't seem to make it work though!!!
:(tried replacing what is there and just adding that last bit - neither worked!!!
What am I doing wrong - when you said smaller than did you mean the minus symbol?
- quoo0
the less than symbol.
- Dno0
<
?
THAT ONE ?
- UndoUndo0
< is less than
> greater than
- Dno0
TA VERY MUCH
;))
Bit slow on the uptake today!
- Dno0
...still not happening!
what am I doing wrong?
I've put the fla up here:
http://www.puremuse.com/follow2m…
...if anyone feels charitable...
:)
- SirG0