旋转Flash影片剪辑
我想做一个类似于这家公司的的闪存菜单,我有旋转,我只是不知道如何使其旋转到顶部。 例如,如果您单击菜单上的“融资”,融资一词就会旋转到顶部。 如果有人能给我如何做到这一点背后的理论,那就太棒了。
编辑:
我想我遇到的问题是我没有任何 x 和 y 位置来获取差异以旋转它。 如果这有道理吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最简单的方法是找出每个按钮笔直的角度(我的意思是,用手或在纸上)。 圆中有 360 度,但要小心,因为闪光角度范围为 -180 到 +180 度(而不是您期望的 0 到 360 度)。
对于旋转,您需要将所有按钮分组在一个圆形轮式影片剪辑中,并将该轮子旋转到您在纸上找到的角度。
我为您制作了一个快速 Flash 示例,您可以在此处查看。 它包括一个补间版本,其移动方式与您提供的链接非常相似。 祝你好运 !
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 !
您是否尝试过对 _rotation 属性使用负值?
正角> 彻头彻尾
负角> 上/左
Did you tried use negative values for _rotation property?
Positive angle > down/right
Negative angle > up/left
您需要两条时间线,一条用于顺时针旋转,一条用于逆时针旋转。 从构建电影开始,标记每个菜单项位于顶部的点。 根据单击的菜单项是小于(从旋转角度来说)还是大于当前位于顶部的菜单项,您可以转到并播放时间线中的该位置。
请注意,作者在其中添加了一些减速和弹跳以获得效果或更大的旋转。
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.
查看此页面上关于 ActionScript Math 的最后一个示例。 使用这种方法,您可以为每个菜单项调用
rotation(this._x, this._y)
的OnPress()
。另一件需要检查的事情是您的旋转点是否位于圆的中间。 如果它位于拐角处(默认情况下),它不会像轮子一样旋转。
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 callrotation(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.