After compiling and running my program, i run into runtime error 1010:
TypeError: Error #1010: A term is undefined and has no properties.
at DC/updateScore()[DC::frame74:36]
This is the piece of code:
function updateScore(e:MouseEvent) {
var i:uint=0;
for(;i<balls.length;i++)
if(balls[i]==e.target)
break;
if(balls[i].isCorrect) {
score++;
timeField.text = new String(score);
}
else {
score--;
timeField.text = new String(score);
}
}
What's the problem? I'm using updateScore function for MouseEvent listener, as you can see.