以90度的间隔完全旋转

时间:2013-08-29 16:34:16

标签: actionscript rotation

我有一个循环菜单,每次单击leftArrow_mc时旋转90度但在270度时按钮停止工作。将度数重新设置为0也会为我做任何事情吗?

    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
}

}

1 个答案:

答案 0 :(得分:1)

继承人你的答案,它的工作原理..如果你需要工作让我知道..迟到所以我不知道为什么这样做会像它一样但我会检查你的补间内的属性(旋转:)。

      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);
    }