这是我的测验应用程序引擎,但我注意到我不能为一个问题分配多个答案而不会弄得一团糟。
answer[0] = ["Green", "Blue", "Red"]
answer[0] = "Green" or "Blue" "Red"
我开始研究多维数组,但我无法让它工作。请帮忙。这是我的引擎:
answer = new Array()
answer[0] = "Green"; //THIS IS LIMITED as there are more answers like red or blue
answer[1] = "2"; //Only one answer
question = new Array();
question[0] = "What colours are in the Rainbow";
question[1] = "1+1";
index = 0;
onEnterFrame = function ()
{
question_txt.text = question[index];
};
enter1.onRelease = function()
{
if (answer_input.text == answer[index])
{
index++;
answer_input.text = "";
}
else
{
answer_input.text = "Incorrect";
}
};