旋转动画摆动

时间:2013-06-04 12:08:18

标签: actionscript-3 flex mxml

我正在尝试创建一个简单的“AJAX loader ”类型的动画,只是一个围绕它的中心旋转的圆圈。我的问题是旋转不顺畅,它来回摆动。

演示SWF:http://swfup.com/view/1mn0

swf的代码:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               width="160" height="160" 

               backgroundColor="0xCCCCCC"
               initialize="loadingAnim.play()">

    <fx:Declarations>
        <s:Rotate angleFrom="0" angleTo="360" autoCenterTransform="true" id="loadingAnim" target="{loader}" 
                  repeatCount="0" duration="2000" easer="{null}" />
    </fx:Declarations>

    <s:Image id="loader" source="@Embed('loader.png')" smooth="true" smoothingQuality="high"
             horizontalCenter="0" verticalCenter="0" />

</s:Application>

我已经确定图像是一个精确的圆圈,如果你想自己检查一下,那么这里是图像文件:

Loading Image

1 个答案:

答案 0 :(得分:0)

图像的中心(73,73)与图形的视觉中心不匹配 这是您的图形,中心标记为:
loader with center marked

因此,它偏离中心(视觉上),导致它摆动。

相关问题