2010-03-27 53 views
0

我有一个影片剪辑。移动影片剪辑效果

其当前y是0,我想将它移动到y 100

如何我目前做的是

onenterframe { Y += 2 } 

我会怎么做,它开始了缓慢的,结束缓慢,但在中间加速?

回答

0

有很多方法可以做到这一点,一个方法是使用由Adobe提供的吐温类(动作2 + 3)

import fl.transitions.Tween; 
import fl.transitions.easing.*; 

var tween:Tween; 
function moveTo(targetY:Number, numberOfFrames:int) { 
    tween = new Tween(this, "y", Regular.easeInOut, y, targetY, numberOfFrames); 
} 

更多信息

你看到flash reference也可以在您自己的onEnterFrame循环中使用Regular.easeInOut函数,或者选择使用许多社区书写补间库之一(如gTween或TweenLite)。