PDA

View Full Version : setting limits for following the mouse on the y-axis



BigDukeyDog
September 8th, 2006, 10:27 AM
hey there i've been looking through the forums and online and i can find stuff that is close to what i want but not exactly. i have a face and i have the eyes following the mouse and would like the eyelids to move as well but not move past a certain point. i've tried doing if-else but as you'll see my coding needs improvement, lots. i have attached two versions. one that has easing which i would love to include but i will settle for just limiting the movements. if anybody could help me i'd greatly appreciate it.

thanks!

duke

glosrfc
September 8th, 2006, 01:53 PM
onClipEvent (load) {
_x = 211.9;
_y = 158;
speed = 5;
}
onClipEvent (enterFrame) {
endY = _root._ymouse;
_y += (endY-_y)/speed;
if (_y>167) {
_y = 166;
} else if (_y<141) {
_y = 140;
}
}

BigDukeyDog
September 12th, 2006, 01:35 PM
Thanks so much I really appreciate it!

Duke