2013-08-29 73 views
0

我有一個圓形菜單,每旋轉90度左右leftArrow_mc被點擊,但在270度時按鈕停止工作。將度數重設爲0也可以爲我做任何事情嗎?完全以90度間隔旋轉

import com.greensock.*; 
    import com.greensock.easing.*; 

    leftArrow_mc.addEventListener(MouseEvent.CLICK, rotateLeft1); 

    function rotateLeft1(event: MouseEvent):void { 
if (bottomWheel_menu_mc.rotation==0) { 
    TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 90, ease:Bounce.easeOut}); 
} else if (bottomWheel_menu_mc.rotation == 90) { 
    TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 180, ease:Bounce.easeOut}); 
} else if (bottomWheel_menu_mc.rotation == 180) { 
    TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 270, ease:Bounce.easeOut}); 
} else if (bottomWheel_menu_mc.rotation == 270) { 
    TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 360, ease:Bounce.easeOut}); 
} 
else if (bottomWheel_menu_mc.rotation == 360) { 
    bottomWheel_menu_mc.rotation == 0 
} 

}

+0

應注意:如果答案可以幫助解決你的問題,你應該接受的答案,或者人們將不太可能幫助你.. – joshua

回答

1

繼承人你的答案,它的工作原理。如果你需要的工作讓我know..its遲到這樣的IM不知道爲什麼這行爲就像它,但我會檢查進入地產(旋轉:)在你的補間內。

 import com.greensock.*; 
     import com.greensock.easing.*; 

    leftArrow_mc.addEventListener(MouseEvent.CLICK, rotateLeft1); 

    function rotateLeft1(event: MouseEvent):void { 
     if (bottomWheel_menu_mc.rotation==0) { 
     TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 90, ease:Bounce.easeOut}); 
     } else if (bottomWheel_menu_mc.rotation == 90) { 
     TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 180, ease:Bounce.easeOut}); 
     } else if (bottomWheel_menu_mc.rotation == 180) { 
     TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 270, ease:Bounce.easeOut}); 
     } else if (bottomWheel_menu_mc.rotation == -90) { 
     TweenLite.to(bottomWheel_menu_mc, 1, {rotation: 0, ease:Bounce.easeOut}); 
     } 
     trace(bottomWheel_menu_mc.rotation); 
    } 
+0

非常感謝!完美的作品!動作不允許超過270度的值?現在我試圖用右箭頭創建相同的腳本(逆時針轉動)。即時通訊得到類似的問題。我要去: 0 - > - 90 270-> 180 180-> 90 90-> 0 –

+0

在理論上應該是oppisite ... – joshua

+0

但我做了同樣的事情,你只是在反向 –