作者:mobiledu2502909447 | 来源:互联网 | 2023-10-12 15:13
importflash.events.MouseEvent;vararr:Array[0,1,2,3,4,5,6,7];varnum:Number0;this.stage.add
import flash.events.MouseEvent;var arr:Array=[0,1,2,3,4,5,6,7];var num:Number=0;
this.stage.addEventListener(MouseEvent.CLICK,handleMouseClick);
function handleMouseClick(e:MouseEvent):void
{num=(num+1)%arr.length;trace(num);
}
输出结果:
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
不错吧……