我得到了这个让我的对象连续旋转的代码
movieClip_2.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously_2);
function fl_RotateContinuously_2(event:Event)
{
movieClip_2.rotation += 100;
}
如何让这个物体在100秒到10秒之间减速5秒?
答案 0 :(得分:0)
var fps:Number = stage.frameRate;
var step:int = 100;
var minStep:int = 10;
var time:Number = 5;
var increment:Number = (step - minStep) / (time * fps);
movieClip_2.addEventListener(Event.ENTER_FRAME, fl_RotateContinuously_2);
function fl_RotateContinuously_2(event:Event)
{
movieClip_2.rotation += step;
step -= increment;
step = Math.max(minStep, step);
}