0

我有一个圆形菜单,每次单击 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
}

}

4

1 回答 1

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);
    }  
于 2013-08-30T14:35:16.180 回答