当我到达证明任何术语向量 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();