Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Animation and Effects

Thread Tools Rate Thread Display Modes
Old 10-15-2004, 09:39 AM   #21
Join Date: May 2004
Location: Sicily
Posts: 332

lol.. very nice. and definitely easier to understand. more along the lines of what I was trying to do - I just couldn't figure out the "then" part of the "if" statement... I gotta start spending more time in the kicks forum...
By the way, pom, also posted your script on my site. If you want it down, let m know..
devonair is offline   Reply With Quote
Old 10-15-2004, 10:57 AM   #22
Xeef's Avatar
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539

hi pom NICE work

i was trying somthing similayr but not come sofare like you
BUT :try to go in a fast circle around it and you will see it's laking
that was one of the reason why i give up this thougt

and my hase 1 big advantage (if somebody need it ) you can now how many time you go around the object

PHP Code:
var drag:Number 8;
needle_mc.onEnterFrame = function() {
distX:Number this._x-this._parent._xmouse;
distY:Number this._y-this._parent._ymouse;
radians:Number Math.atan2(distYdistX);
targetRotation = ((radians/Math.PI)*180);
    if (
targetRotation<0) {
Q1 += (targetRotation-QQ1);
QQ1 targetRotation;
    if (
targetRotation>0) {
Q2 += (targetRotation-QQ2);
QQ2 targetRotation;
    if (
Q3-180>targetRotation) {
Q1 += 360;
Q3 targetRotation;
    if (
Q4+180<targetRotation) {
Q2 -= 360;
Q4 targetRotation;
Q5 Q1+Q2;
rotateAmt = (Q5-this._rotation)/drag;
+= (Q5-R)/drag;
this._rotation R;
C._x needle_mc._x;
C._y needle_mc._y;
    for (
Q6=0Q6>RQ6--) {
    for (
Q6=0Q6<RQ6++) {
Q is my favorite in the moment

test your self -->http://www.actionscript.org/forums/s...86&postcount=8
Xeef is offline   Reply With Quote
Old 03-28-2007, 11:40 AM   #23
Registered User
Join Date: Mar 2007
Posts: 5

Fantastic work!

I've been pulling my hair out for a couple of evenings - started on Pom's method - failed! (boo!) - moved over to Quadrants and Xeef's method - gave up!

Searched actionscript.org - and what do you know! - you've all done the math! and so cleanly.

Excellent job guys, appreciated! All makes sense once you know how!

And all done so long ago...! ha!

Last edited by mcm; 03-28-2007 at 11:50 AM.
mcm is offline   Reply With Quote
Old 04-19-2007, 01:49 AM   #24
Registered User
Join Date: Jun 2006
Posts: 8

you guys seem to be on track to what im looking to do

how could I use the code above to ease the rotation to where I can pick a menu item
southern is offline   Reply With Quote
Old 05-16-2007, 02:29 PM   #25
Registered N00b
Join Date: May 2007
Location: Cornwall, Ontario
Posts: 1

I am trying to do something very similar to that. I want to have two spinning records on two turntables on a website that stop spinning when the user mouses over and holds the mouse down. The vinyl can then be rotated by the user when the mouse is dragged while the button is down.

I am a DJ and graphic designer and want to fit this in to my website redesign.

good work by the way guys, I'm just figuring out this action script stuff and it's kinda mind boggling at first. you guys are brilliant.
SoundScientist is offline   Reply With Quote
Old 06-13-2007, 11:20 PM   #26
Registered User
Join Date: Jun 2007
Posts: 1

Hi guys, i need to do the same thing but i can't ! Just like the Suzuki BMX website. i have a MovieClip with Text Buttons on it, the thing is that when i rollover a button the symbol stops rotating, just like the Suzuki website, exactly like that. Can someone show us a code for that ?


Last edited by danieldiaz; 06-13-2007 at 11:22 PM.
danieldiaz is offline   Reply With Quote
Old 02-13-2008, 10:54 AM   #27
Senior Member
Join Date: Oct 2007
Location: London
Posts: 120
Default perfect

Nice one POM, I've been trying to work this one out for ages...

This little solution is going in the code library!

danjp is offline   Reply With Quote
Old 02-14-2008, 06:21 AM   #28
village halfwit
pixelwit's Avatar
Join Date: Jul 2001
Location: USA, PA
Posts: 3,339

Not sure how I missed this thread but I did.

I use code like this:

ActionScript Code:
// // Some variables. var flex = .9// How Springy (0 to 1). var drag = .05; // How heavy (0 to 1). var goalRot = 0;// Where the arrow is pointing. var step = 0;   // Used for easing. // // Create an arrow. createEmptyMovieClip("Arrow", 10); with(Arrow){     beginFill(0xFF0000);     lineTo(-5, -10);     lineTo(100, 0);     lineTo(-5, 10);     lineTo(0, 0);     _x = 200;     _y = 200; } // // Adjust arrow every frame. onEnterFrame = function(){     // Angle between arrow and mouse in radians.     goalRot = Math.atan2(_ymouse-Arrow._y, _xmouse-Arrow._x);     // Angle between arrow and mouse in degrees.     goalRot *= (180/Math.PI);     // Difference between where the arrow needs to be and where it currently is.     var d = goalRot-Arrow._rotation;     // Normalize the difference so the arrow rotates the proper direction.     if(d < -180){         d+=360;     }else if(d > 180){         d-=360;     }     // Apply easing to the difference.     step = (step*flex) + (d*drag);     // Move the arrow.     Arrow._rotation += step; } // //

There are no answers, only choices.

Last edited by pixelwit; 02-15-2008 at 08:12 PM.
pixelwit is offline   Reply With Quote
Old 02-15-2008, 07:58 PM   #29
Senior Member
Join Date: Apr 2007
Posts: 4,908

Originally Posted by pixelwit View Post
Not sure how I missed this thread but I did. I use code like this
Hi pixelwit, I tried your code and it throws no errors but also does not do anything, is there more to it, or maybe I am misunderstanding?

It looks interesting and I wanted to try it
asf8 is offline   Reply With Quote
Old 02-15-2008, 08:10 PM   #30
Super Moderator
ASWC's Avatar
Join Date: Dec 2007
Location: Greenville, SC
Posts: 6,742


var step=0;
ASWC is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Jump

All times are GMT. The time now is 03:05 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, 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.