如何获取button的点击次数
展开全部
as2写法:
var myNum:Number = 0;
function mySelectFun() {
myNum++;
if (myNum%2 == 1) {
trace("执行语句块1");
} else {
trace("执行语句块2");
}
}
myBtn.onRelease = function() {
mySelectFun();
}; as3写法:var myNum:Number = 0;
var mySelectFun:Function=function():void {
myNum++;
if (myNum%2 == 1) {
trace("执行语句块1");
} else {
trace("执行语句块2");
}
};
myBtn.addEventListener(MouseEvent.CLICK,mySelectFun);
var myNum:Number = 0;
function mySelectFun() {
myNum++;
if (myNum%2 == 1) {
trace("执行语句块1");
} else {
trace("执行语句块2");
}
}
myBtn.onRelease = function() {
mySelectFun();
}; as3写法:var myNum:Number = 0;
var mySelectFun:Function=function():void {
myNum++;
if (myNum%2 == 1) {
trace("执行语句块1");
} else {
trace("执行语句块2");
}
};
myBtn.addEventListener(MouseEvent.CLICK,mySelectFun);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询