hi!

i produced this code with the aid of a tutorial. it seemed to work fine at first. but in practice, when altering the movement speed, the movement suddenly stops at some point... i don't know enough actionscript to be able to tell why.

here's the code i'm using in the 1st frame of mc timelines:

acceleration = 32
newpos = function () {
ranx = Math.round((Math.random ()*550));
rany = Math.round ((Math.random ()*30));
}
newpos();
this.onEnterFrame = function() {
this._x += ((ranx-this._x)/acceleration);
this._y += ((rany-this._y)/acceleration);
if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
newpos();
}
};

the acceleration value was 10 at first, but the tut said that it can be changed. i want my objects to move more slowly, so i did. why does it get stuck?

thanks for help in advance,
mar