2013-08-17 214 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; 
    } 
}