Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 连续旋转图像_Apache Flex_Actionscript 3 - Fatal编程技术网

Apache flex 连续旋转图像

Apache flex 连续旋转图像,apache-flex,actionscript-3,Apache Flex,Actionscript 3,我想在页面加载时连续旋转图像。代码可以在页面加载时进行1次旋转,但为了连续获得相同的效果,我在无限while循环中包含了.play()语句,如下所示。但它会导致页面挂起,而什么也不显示 while (i == 1) { if (rotEff.isPlaying != true) { rotEff.play(); } } 任何关于如何实现这一效果的建议都会非常有帮助,非常简单。只需设置一个enterframe侦听器,以便在加载时进行操作(不要使用时间线动画

我想在页面加载时连续旋转图像。代码可以在页面加载时进行1次旋转,但为了连续获得相同的效果,我在无限while循环中包含了.play()语句,如下所示。但它会导致页面挂起,而什么也不显示

while (i == 1)
{
    if (rotEff.isPlaying != true)
    {
        rotEff.play();
    }
}

任何关于如何实现这一效果的建议都会非常有帮助,非常简单。只需设置一个enterframe侦听器,以便在加载时进行操作(不要使用时间线动画)


加载完成后,只需删除侦听器。

非常简单。只需设置一个enterframe侦听器,以便在加载时进行操作(不要使用时间线动画)


加载完成后,只需删除侦听器。

尝试将
效果
对象的
repeatCount
属性设置为0,使其无限重复:

<fx:Declarations>
    <s:Rotate id="rotate" target="{image}" angleBy="360" duration="1000" repeatCount="0" autoCenterTransform="true"></s:Rotate>
</fx:Declarations>

尝试将
Effect
对象的
repeatCount
属性设置为0,使其无限重复:

<fx:Declarations>
    <s:Rotate id="rotate" target="{image}" angleBy="360" duration="1000" repeatCount="0" autoCenterTransform="true"></s:Rotate>
</fx:Declarations>

如果这是Flex应用程序,我建议您使用
定时器
对象。

如果这是Flex应用程序,我建议您使用
定时器
对象。

此obj是图像的对象。。。?你能再解释一下吗,怎么做。。。?我需要在创建完成时添加事件列表器,以及如何删除它…obj是您希望移动的任何对象(电影剪辑/位图/等)的实例名称。在将实例添加到显示列表(舞台上)之后立即添加它,当加载的内容完成其加载过程时,只需
obj.removeEventListener(Event.ENTER_FRAME,doRotate)
将其删除。as3 101.hmmm…之前我在动作脚本中使用了一个rotate类来设置图像从中心旋转。公共函数rotateImgEffect(img:Image):void{var rotEff:Rotate=new Rotate();//img是MXML文件rotEff.target=img;rotEff.originX=img.width/2;rotEff.originY=img.height/2;rotEff.duration=5500;rotEff.angleFrom=img.rotation;rotEff.angleTo=img.rotation+360;rotEff.play();}现在如何设置…?如果我删除eventlistner,图像在最初的一点之后仍然保持静态transition@Bosworth99我认为你们两人之间可能有点混淆,因为你们可能指的是AS3项目,而sandy可能指的是Flex项目,但我可能错了。这个obj是图像的对象。。。?你能再解释一下吗,怎么做。。。?我需要在创建完成时添加事件列表器,以及如何删除它…obj是您希望移动的任何对象(电影剪辑/位图/等)的实例名称。在将实例添加到显示列表(舞台上)之后立即添加它,当加载的内容完成其加载过程时,只需
obj.removeEventListener(Event.ENTER_FRAME,doRotate)
将其删除。as3 101.hmmm…之前我在动作脚本中使用了一个rotate类来设置图像从中心旋转。公共函数rotateImgEffect(img:Image):void{var rotEff:Rotate=new Rotate();//img是MXML文件rotEff.target=img;rotEff.originX=img.width/2;rotEff.originY=img.height/2;rotEff.duration=5500;rotEff.angleFrom=img.rotation;rotEff.angleTo=img.rotation+360;rotEff.play();}现在如何设置…?如果我删除eventlistner,图像在最初的一点之后仍然保持静态transition@Bosworth99我认为你们两人之间可能有点混淆,因为你们可能指的是AS3项目,而sandy可能指的是Flex项目,但是我可能错了。谢谢taurayi…设置repeatCount解决了这个问题。但是从一个完整的360轮到另一轮有一点过渡滞后。消除这个问题是否可行?谢谢taurayi…设置repeatCount解决了这个问题。但是从一个完整的360轮到另一轮有一点过渡滞后又一轮..摆脱它也可行吗。。?
<fx:Declarations>
    <s:Rotate id="rotate" target="{image}" angleBy="360" duration="1000" repeatCount="0" autoCenterTransform="true" easer="{null}"></s:Rotate>
</fx:Declarations>