Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

spinning movie or graphic

Status
Not open for further replies.

keen01

MIS
Nov 16, 2004
73
US
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?
 
\\ try this:

Code:
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top