我有一个循环菜单,每次单击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
}
}
答案 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);
}