弯曲从底部而不是中间旋转椭圆
Flex 还遇到了另一个小问题... 我制作了一个椭圆,我想动态旋转它。 制作了 ah:slider ,它改变了椭圆的rotate=""值。 而且它旋转得很好。但旋转点在椭圆的中间。
我希望它位于底部 (y) 和中间 (x)。
椭圆有一些transformY和transformX参数,但它们没有效果?
我的功能
private function rotateRadius():void {
if(wind.selected) {
selected.radiusDisp.rotation = radiusRotate.value;
}else {
}
}
如果有人能给我提示的话那就太好了
got another little provlem with flex ...
i've made a ellipse and i want to rotate it dynamicly.
made a h:slider which change the rotate="" value of the ellipse.
and it rotates fine. but the rotation point is in the middle of the ellipse.
i want it at the bottom (y) and middle (x).
there are some transformY and transformX arguments for the ellipse, but they have no effect?
my function
private function rotateRadius():void {
if(wind.selected) {
selected.radiusDisp.rotation = radiusRotate.value;
}else {
}
}
would be great if someone can give me a hint
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是改变物体旋转方式的最简单方法。
如果您希望椭圆在表面上摇摆/滚动,则需要添加一点三角函数来计算注册点。
哈特哈,
FT任务
That is the simplest way to change the way an object is rotating.
If you want your ellipse to rock/roll on the surface, you need to add a bit trigonometry to calculation of the registration point.
HTH,
FTQuest
有几种方法可以做到这一点,最简单的方法可能是将椭圆嵌套在另一个显示对象中(以便您想要旋转的点位于新显示对象的中心)。这对于弹性布局来说可能是一个痛苦,因为你现在有一个比椭圆形“更大”的对象。
另一个选项(正确的方法)是使用变换对象,请参阅
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#transform
和
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3 /flash/geom/Transform.html#matrix
There are a few ways to do that, probably the easiest is to nest your ellipse within another display object (so that the point you want to rotate by is at the center of the new display object). This can be a pain with flex layout though as you now have a 'bigger' object than your ellipse there.
The other option (the correct way) is to use the transform object, see
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#transform
and
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/geom/Transform.html#matrix