The following code is what I have in an actions frame:
function FLOAT_engine() {
this._x = this.cenX+Math.sin(this.angleX)*this.rangeX;
this._y = this.cenY+Math.sin(this.angleY)*this.rangeY;
this.angleX += this.xspeed;
this.angleY += this.yspeed;
}
floaty.onEnterFrame = FLOAT_engine;
floaty2.onEnterFrame = FLOAT_engine;
etc.
And in my movieclip (floaty) I have the variables:
onClipEvent (load) {
cenX = this._x;
cenY = this._y;
angleX = 0;
angleY = 0;
rangeX = 5;
rangeY = 5;
xspeed = .05;
yspeed = .06;
}
How would I got about re-writing this code so it is all in the actions frame? The way that I have it set up now, I’d have to paste the variables into every movieclip. It would be a pain if I ever wanted to change the values. ;( Thanks in advance.