Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums Spinning a movie clip on center axis? (and more)
 User Name Remember Me? Password
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 Thread Tools Rate Thread Display Modes
 05-15-2005, 09:46 AM #1 Oli-G Member   Join Date: May 2005 Posts: 62 Spinning a movie clip on center axis? (and more) Hey fellas, I have a movie clip on the stage, which is a record. What I want, is for the user to be able to move the mouse over, click down, and spin the record left and right. To confuse matters, I would like to keep the record spinning (tapering to a stop) after they let go and flick the cursor across the screen. So if they hold the mouse down, the record will rotate with the mouse. and perhaps some lag which will be easy enough. Anyone know how to do this? I also need to set a maximum velocity (?), whereby when it is spun hard enough, an event is triggered. I guess the most essential thing is to be able to rotate the object, with tapering etc being secondary. I'm told it uses fairly simple pythagoras etc, but i'm yet to even use a simple rotate command. My teacher did send a good detailed example, but I had a fair bit of difficulty making heads or tails given that there were rotation limits imposed, etc Any ideas? cheers
 05-15-2005, 11:47 AM #2 Navarone Don     Join Date: Feb 2003 Location: Akron, Ohio USA Posts: 2,077 I am not sure I know how to do everything your asking, but here is some rotation code I used, it might get you started. I used a movie clip with the instance name of "cd". ActionScript Code: ```cd.onEnterFrame = function (){     this._rotation -=30; //sets the rotation of the movie clip     //trace(this._x);     // this moves the movie clip 25 pixels to the left     //if(this._x>100) {         //this._x-=50     //}  }``` __________________ Damn the torpedoes! Full speed ahead.
 05-15-2005, 11:58 AM #3 Oli-G Member   Join Date: May 2005 Posts: 62 Hey dude, Thanks for the reply. I threw the code in though and the record was spinnin all over the place! At least it was movin tho eh . Basically I need it to act kinda similar to say, a volume knob, on a synth, in regards to how the user can interact with it. The other stuff will be seperate, I guess.
 05-15-2005, 03:26 PM #4 Oli-G Member   Join Date: May 2005 Posts: 62 Well, the general consensus on other forums is that this is gonna be a bit over my head, so i'm changing it. What I now would like is, when the record is just clicked, to spin by itself, and gradually increase until it hits a top speed, where an event is triggered. Any ideas? cheers!
 05-15-2005, 07:57 PM #5 Navarone Don     Join Date: Feb 2003 Location: Akron, Ohio USA Posts: 2,077 Try this and let me know what your think. You can adjust the rotation speed by increasing the rotation value or slow it down as the case may be. __________________ Damn the torpedoes! Full speed ahead.
 05-15-2005, 08:35 PM #6 pungkerton Registered User     Join Date: May 2005 Posts: 51 Maybe something like this: ActionScript Code: ```onClipEvent( enterFrame ){     if( rotateSpeed == ( undefined || null ) ){         _global.rotateSpeed = 1;     } else {         if( rotateSpeed < 30 ){             _global.rotateSpeed++;         }     }     this._rotation = this._rotation + rotateSpeed; }``` 30 is the maxspeed. the increment to speed up is 1; for more, change _global.rotateSpeed++; to _global.rotateSpeed = _global.rotateSpeed + n;. I dropped this onto the movieclip rather than the frame.
05-15-2005, 08:49 PM   #7
pungkerton
Registered User

Join Date: May 2005
Posts: 51

Here's what I came up with...
Attached Files
 record.zip (7.5 KB, 284 views)

 05-15-2005, 09:31 PM #8 Oli-G Member   Join Date: May 2005 Posts: 62 Great work guys, very much appreciated. Last edited by Oli-G; 05-16-2005 at 06:09 AM.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

All times are GMT. The time now is 09:42 PM.

///

## Categories

 Contact Us - Home Page - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.