我正在做一个带有 5 个动态文本的随机数生成器。我想要做的是当 showRandom_txt = 1 那么其他文本应该等于零
//1.
function randomNumbers(min:Number,max:Number) {
var Results:Number=Math.floor(Math.random()*max)+min;
return Results;
}
function randomNumber(){
var Results:Number=Math.floor(Math.random()*(1+1-0))+0;
return Results;
}
//2.
generate_btn.addEventListener(MouseEvent.CLICK, showRandomnumber);
//3.
function showRandomnumber(event:MouseEvent):void{
showRandom_txt.text = randomNumber();
showRandom2_txt.text = randomNumbers(0,9);
showRandom3_txt.text = randomNumbers(0,9);
showRandom4_txt.text = randomNumbers(0,9);
showRandom5_txt.text = randomNumbers(0,9);
}
我是 AS3 的新手,非常感谢您的帮助。谢谢