Why is it doing this??
What I want is for my mc to slide to a new random x position when it is less than 5 pixels away from its target, it keeps doing this. the problem is for some bloody &£$(()* reason my random numbers only keep going up!! why is this?? i want to produce random numbers between 1 and 770 - this is my code…
Please somebody help me please…
onClipEvent (enterFrame) {
_root.xdif = _root.targetx-_x;
if (_root.xdif<5) {
_root.targetx = Math.floor(Math.random()*(770))+1;
}
if (_root.xdif<5) {
this._x = null;
} else {
this._x += (_root.xdif/50);
}
}