当我到达证明任何项向量answer1不同于任何向量rightAnswer1(在条件中:“answer1 [i1]!= rightAnswer1 [i1]”)的行时,我需要离开函数开关/外壳休息前退出开关/外壳功能;
switch (currentFrame)
{
case 1:
for (var i1:int = 0; i1 < 8; i1++)
{
if (answer1[i1] != rightAnswer1[i1])
{
anyArray[currentFrame - 1] = 2;
trace("Answer " + i1 + " is wrong!");
break; // I need to leave the switch/case function here
}
}
trace("Answer is right!");
anyArray[currentFrame - 1] = 1;
break;
case 2:
for (var i2:int = 0; i2 < 3; i2++)
{
if (answer2[i2] != rightAnswer2[i2])
{
anyArray[currentFrame - 1] = 2;
break;
}
}
anyArray[currentFrame - 1] = 1;
break;
default:
trace("ERROR");
break;
}
if (anyArray[currentFrame - 1] == 1)
light.play();
else
error.play();
谢谢,这帮了我很多! – bsberti