I am trying to find the index from an array using a loop function, but I am getting an error:
private function findMatch(matchValue:int):int {
for (var i:int = 0; i < playersList.length; i++) {
if (playersList[i].value + matchValue == levelTarget) {
return i;
}
}
}
Is it not possible to return a value from inside a loop, or rather, am I getting an error everytime it doesn't return a value?!?