I've got something that spins in a MC 360 but in that movie clip I do it by having it rotate over 1200 frames. Is there a way to do this with code and not waste the timeline?
function spinRound(speed) {
this.rot = 0;
yourClip.onEnterFrame = function() {
this.rot += Math.floor(speed);
if (this.rot>=360) {
this.rot = 360;
delete this.onEnterFrame;
}
this._rotation = this.rot;
};
}
//useage example
spinRound(5);
\\ "yourClip" is the instance name of the movieclip you want to rotate. and the function to spin this clip is called "spinRound()" and it takes one argument... that argument is called speed, and it adjusts how fast you want the spin to be.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.