function easeName(destX, destY, currX, currY) {
onEnterFrame = function () {
var easeX = (destX-currX)*0.3;
var easeY = (desty-currY)*0.3;
currX += easeX;
currY += easeY;
};
}
easeName(0, 0, mc._x, mc._y);
this doesnt seem to work. the values are fed in and calculated. it does all the calculations. but nothing moves.
is it because currX and currY are the values of mc._x and mc._y AND not the actual movieclips?
I need help. Thanks
is it because currX and currY are the values of mc._x and mc._y AND not the actual movieclips?
It’s because you’re effectively just passing numbers into the function instead of references (or pointers… in another language’s terms) to the numbers.
function easeName(destX, destY, mc) {
onEnterFrame = function () {
var easeX = (destX-mc._x)*0.3;
var easeY = (desty-mc._y)*0.3;
mc._x += easeX;
mc._y += easeY;
};
}
easeName(0, 0, mc);
ah ok Thanks. it works, sort of.
for some reason the Y axis does not move. I traced easeY and I get “NaN” values… What does “Not a Number” mean. btw i did change desty to destY. so thats not an issue.
bah, it was a typo somewhere else. its all good!
Thanks