FLASH AS3.0 里 怎么使输入文本框里 只输入数字 下面是我的代码 让t3.text 只能输入数字
t1.text=String(Math.round(Math.random()*100));t2.text=String(Math.round(Math.random()...
t1.text = String(Math.round(Math.random ()*100));
t2.text = String(Math.round(Math.random ()*100));
function jx(event:Object){
if ((int(t1.text)+int(t2.text))==int(t3.text)){
t4.text = "正确";
}else{
t4.text = "错误";
}
}
bt1.addEventListener("click",jx);
function jx1(event:Object){
t1.text = String(Math.round(Math.random ()*100));
t2.text = String(Math.round(Math.random ()*100));
t3.text = String("");
t4.text = String("");
}
bt2.addEventListener("click",jx1); 展开
t2.text = String(Math.round(Math.random ()*100));
function jx(event:Object){
if ((int(t1.text)+int(t2.text))==int(t3.text)){
t4.text = "正确";
}else{
t4.text = "错误";
}
}
bt1.addEventListener("click",jx);
function jx1(event:Object){
t1.text = String(Math.round(Math.random ()*100));
t2.text = String(Math.round(Math.random ()*100));
t3.text = String("");
t4.text = String("");
}
bt2.addEventListener("click",jx1); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询