checkX = function (dx, oldVal, newVal)
{
if (oldVal<newVal)
{
trace(“moving right”);
} else if (oldVal>newVal)
{
trace(“moving left”);
}
return newVal;
};
checkY = function (dy, oldVal, newVal)
{
if (oldVal<newVal)
{
trace(“down”);
} else if (oldVal>newVal)
{
trace(“up”);
}
return newVal;
};
this.watch(“xdir”, checkX);
this.watch(“ydir”, checkY);
this.onMouseMove = function()
{
xdir = _xmouse;
ydir = _ymouse;
};
Gosh I miss AS2 SO MUCH, things were so easy ! That Match function is MAGIC !
Copy this entire code into frame 1 of your AS2 file, it’s from a tutorial on this very site.