2013-08-17 215 views
1
if (rotCW) 
{ 
    tramp1.rotation += 3; 
    if (tramp1.rotation = 90){ 
     tramp1.rotation += 0; 
    } 
} 

我试图让这个如果影片剪辑的旋转是90,其转速为0 但每次我按'键(触发rotCW)时,动画片剪辑的旋转刚刚变为90.闪存(AS3)影片剪辑旋转

回答

1

你的问题是第二种情况下的分配。您需要使用“==”

if (rotCW) 
{ 
    tramp1.rotation += 3; 
    if (tramp1.rotation == 90){ 
     tramp1.rotation += 0; 
    } 
} 

编辑:无论角度如何,您都执行的+ = 3行。如果你是90岁而不想,你可以测试相反的情况,并在这种情况下增加。例如:如果小于90.

if (rotCW) 
{ 
    if (tramp1.rotation < 90){ 
     tramp1.rotation += 3; 
    } 
}