tags:

views:

1900

answers:

4

I would like to do a flash menu similar to this company's, I have the rotation down, I just cannot figure out how to make it rotate to the top. For example, if you click "Financing" on their menu, the word financing rotates to the top. If someone could just give me the theory behind how to do that, that would be awesome.

EDIT:

I guess the problem I have is that I don't have any x and y position to get the difference from in order to rotate it. If that makes sense?

A: 

Did you tried use negative values for _rotation property?

Positive angle > down/right Negative angle > up/left

Héctor Vergara R.
A: 

You need two timelines, one for rotating clockwise and one for counterclockwise. From building the movie, label the point were each menu item is at the top. Depending on whether the clicked menu item is less than (rotationally speaking) or greater than the item that is currently at the top you gotoandplay that location in the timeline.

Note the author has put a bit of deceleration and bounce in there for effect or larger rotations.

Diodeus
A: 

Take a look at the last example on this page on ActionScript Math. Using this approach, you'd have the OnPress() for each menu item call rotation(this._x, this._y).

One other thing to check is that your rotation point is in the middle of the circle. If it is at the corner, as is the default, it will not rotate like a wheel.

DavGarcia
+1  A: 

The simplest way to do that, is figure out the angles at which each button would be straight (i mean, by hand or on paper). There's 360degrees in a circle, however be careful as flash angle ranges from -180 to +180 degrees (not from 0 to 360 like you would expect).

For the rotation, you need to group all the buttons within one circular wheel movieclip, and rotate that wheel to the angles you've discovered on paper.

I made a quick flash example for you, you can see here. It includes a tweened version, that moves in a very similar way as the link you provided. Good luck !

sthg
You sir are the man. Awesome, awesome stuff.
Zach