Hi!
Okay, so, I’ve been scoring the internet for help or ideas or SOMETHING to help me figure this out…So, I have a movieclip with 4 frames: one for northwest, one for southwest, one for southeast, one for northeast. What I want that movie clip to do is, well, walk.
When it walks, I want to switch the frames depending on the position of the mouse…i.e., if its in the bottom-left corner, the movieclip switches to the specific frame.
I’m sure this has been posted about before, but I COULDN’T FIND ANYTHING that’s helpful to this. So, sorry if I’m reposting…
This is the current code I have. It’s currently kind of glitchy…Just rotates the avatar based on the specific mouse position, walking’s not added yet or anything.
checkX = function (dx, oldVal, newVal) {
if (oldVal<newVal) {
_root.avatar.gotoAndStop(4);
} else if (oldVal>newVal) {
_root.avatar.gotoAndStop(3);
}
return newVal;
};
checkY = function (dy, oldVal, newVal) {
if (oldVal<newVal) {
_root.avatar.gotoAndStop(2);
} else if (oldVal>newVal) {
_root.avatar.gotoAndStop(1);
}
return newVal;
};
this.watch("xdir", checkX);
this.watch("ydir", checkY);
this.onMouseMove = function() {
xdir = _xmouse;
ydir = _ymouse;
};
How would I fix it to do what I want? Any tutorials anyone knows of that I may have missed?
Thanks a lot, hoping for a reply ASAP