我希望能够检查数组中的空条目,如果它们是空条目,则打印一条消息。
然后,当没有我想继续该程序时。
我真的看不出我做错了什么。
var mainArray:Array = new Array (6);
function addNumbers(event:MouseEvent):void
{
userNumber1.selectable = false;
userNumber1.type = TextFieldType.DYNAMIC;
userNumber2.selectable = false;
userNumber2.type = TextFieldType.DYNAMIC;
userNumber3.selectable = false;
userNumber3.type = TextFieldType.DYNAMIC;
userNumber4.selectable = false;
userNumber4.type = TextFieldType.DYNAMIC;
userNumber5.selectable = false;
userNumber5.type = TextFieldType.DYNAMIC;
userNumber6.selectable = false;
userNumber6.type = TextFieldType.DYNAMIC;
mainArray[0] = Number(userNumber1.text);
mainArray[1] = Number(userNumber2.text);
mainArray[2] = Number(userNumber3.text);
mainArray[3] = Number(userNumber4.text);
mainArray[4] = Number(userNumber5.text);
mainArray[5] = Number(userNumber6.text);
noNull();
}
function noNull()
{
var e;
var noNulls:Boolean = new Boolean();
noNulls = false;
for (e = 0; e < 6; e++)
{
if (mainArray[e] == null)
{
genericText.text = "Make sure all boxes are filled!";
}
else
{
noNulls = true;
}
}
if (noNulls == true)
{
duplicateCheck();
}
}