我对as3很新,所以对你们大多数人来说这可能是非常明显的:P 我正在使用numPressed函数(计算鼠标点击次数),需要在第6次点击后重置鼠标点击次数... 这就是代码的样子:
var numPressed:Number = 0;
any_mc.addEventListener(MouseEvent.CLICK, countUp);
function countUp(evt:MouseEvent):void {
numPressed++;
if (numPressed == 1) {
any_mc.gotoAndPlay(1);
}
else if (numPressed == 2) {
any_mc.gotoAndPlay(2);
}
else if (numPressed == 3) {
any_mc.gotoAndPlay(3);
}
else if (numPressed == 4) {
any_mc.gotoAndPlay(4);
}
else if (numPressed == 5) {
any_mc.gotoAndPlay(5);
}
}
非常感谢任何帮助!
答案 0 :(得分:1)
function countUp(evt:MouseEvent):void
{
any_mc.gotoAndPlay(numPressed++);
if(numPressed > 5)
numPressed = 1;
}