make a symbol called ‘dot’ and put it on the _root stage
if you change speed to 5 the script works just fine … moving the ball to the point with easing. but i want it without easing … just a steady movement.
i made this script
xspeed = (dot._x - endX)/10;
yspeed = (dot._y - endY)/10;
onMouseDown = function () {
endX = _root._xmouse;
endY = _root._ymouse;
};
onEnterFrame = function () {
if (dot._x>=endX) {
dot._x -= xspeed;
}
if (dot._x<endX) {
dot._x += xspeed;
}
if (dot._y>=endY) {
dot._y -= yspeed;
}
if (dot._y<endY) {
dot._y += yspeed;
}
};
but when i put that on there the _x and _y don’t get done at the same time. so it doesn’t go in a straight line to the new point … it turns a corner when the _x or _y is complete. depending on which one gets done first
Well what are you trying to do? If you want it to ease to the point at the same time, why don’t you just use the first code? It does exactly what you said you want it to.
no
no elasticity no easing nothing special. just move to wherever the mouse has clicked
if the mouse is clicked at 300x300 then i want the dot to move to 300x300. but not jump, so setting the _x and _y to the _xmouse and _ymouse onMouseDown would not work. I want it to move there. no easing … just move at a steady rate
*Originally posted by kax *
**i’m a bit busy right now but i’ll give a hint…
check the random movement tutorial. **
Precisely
In order to do what you want to do you will have to use trig to get the distancex and distancey and find the hypotenuse to travel along. I actually have to go now too, but hopefully that helps.