I need to float movieclips and they only move like 2-5 pixels each time off the x or y axis.
I got the codes right but now I need them to start in the stated ._x and ._y instead of being at random.
It would even be better if these codes can be also controlled by mouse movement but I doubt it’s possible because it’s being controlled by onClipEvent already?
thanks for the help in advance!
onClipEvent(load) {
acceleration = 10
newpos = function () {
ranx = Math.round((Math.random ()*10));
rany = Math.round((Math.random ()*10));
}
newpos();
}
onClipEvent(enterFrame) {
this._x += ((ranx-this._x)/acceleration);
this._y += ((rany-this._y)/acceleration);
if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
newpos();
}
}