我正在开发一个 adobe air 交互式表格项目,我正在尝试对一些旋转进行补间。在大多数情况下,它工作正常,但偶尔它会在版本周围一直旋转,只是向另一个方向旋转一点。有没有人能在补间中防止这种情况的好方法?
我的代码片段:
var rotatePos:Number;
if (event.rotation > 180) { rotatePos = event.rotation - 360; } else { rotatePos = event.rotation; }
var rotateDifference:Number = Math.abs(Math.abs(rotatePos) - Math.abs(Number(rotationCurrent[tempCircleNumber])));
if ( rotateDifference > 4 && rotateDifference < 60) {
rotateTheFiducial();
} else if ( rotateDifference > 100 ) {
trace("too far, ignore : " + rotateDifference);
}
function rotateTheFiducial():void
{
try
{
var cardTweenRotation:Tween = new Tween(MovieClip(fiducialArray[tempCircleNumber]), "rotation", Regular.easeOut, Number(rotationCurrent[tempCircleNumber]), rotatePos, .2, true);
rotationCurrent[tempCircleNumber] = rotatePos;
}
catch (e:Error)
{
trace(fiducialId + " : Rotate Error : " + e);
}
}