Flash 如何使它们都具有sam速度(AS3)

Flash 如何使它们都具有sam速度(AS3),flash,actionscript-3,animation,tween,Flash,Actionscript 3,Animation,Tween,我目前有一个无限旋转的动画,但它只是太快开始。。。我试着将fps降低到12,但这只是跳过。。。。是否有可能通过以下代码使动画变慢: //Import TweenMax import com.greensock.TweenMax; //Save the horizontal center var centerX:Number = stage.stageWidth / 2; //Save the width of the whole gallery var galleryWidth:Number

我目前有一个无限旋转的动画,但它只是太快开始。。。我试着将fps降低到12,但这只是跳过。。。。是否有可能通过以下代码使动画变慢:

//Import TweenMax
import com.greensock.TweenMax;

//Save the horizontal center
var centerX:Number = stage.stageWidth / 2;

//Save the width of the whole gallery
var galleryWidth:Number = infiniteGallery.width;

//Speed of the movement (calculated by the mouse position in the moveGallery() function)
var speed:Number = 0.02;

//Add an ENTER_FRAME listener for the animation
addEventListener(Event.ENTER_FRAME, moveGallery);

function moveGallery(e:Event):void {

    //Calculate the new speed
    speed = -(0.02 * (mouseX - centerX));

    //Update the x coordinate
    infiniteGallery.x+=speed;

    //Check if we are too far on the right (no more stuff on the left edge)
    if (infiniteGallery.x>0) {

        //Update the gallery's coordinates
        infiniteGallery.x= (-galleryWidth/2);
    }

    //Check if we are too far on the left (no more stuff on the right edge)
    if (infiniteGallery.x<(-galleryWidth/2)) {

        //Update the gallery's coordinates
        infiniteGallery.x=0;
    }
}
//导入TweenMax
导入com.greensock.TweenMax;
//保存水平中心
var centerX:Number=stage.stageWidth/2;
//保存整个库的宽度
var galleryWidth:Number=infiniteGallery.width;
//移动速度(通过moveGallery()函数中的鼠标位置计算)
无功转速:数值=0.02;
//为动画添加输入帧侦听器
addEventListener(Event.ENTER_FRAME,moveGallery);
功能移动库(e:事件):无效{
//计算新的速度
速度=-(0.02*(mouseX-centerX));
//更新x坐标
无穷远。x+=速度;
//检查我们是否离右边太远(左边没有更多的东西)
如果(无穷远x>0){
//更新库的坐标
infiniteGallery.x=(-galleryWidth/2);
}
//检查我们是否离左边太远(右边没有更多的东西)

如果(infiniteGallery.x尝试在
速度=-(0.02*(mouseX-centerX));

调整速度?var-speed:number=0.01;speed=-(speed*(mouseX-centerX));是的,但如果我这样做,它会立即停止动画。