Does anyone know how to capture the count of an array when the array value matches the value of a text box. I have tried looping through the array with a "for" loop, and
using an "if" statement and a break command to get out of the loop, but I cannot figure out how to get the count value of the array. Here are some of the actionscripts
I have used. The "out" is a Dynamic text box. txtValue is the value of the data to match in the array. THe only way I could get the data I want is to use a long drawn out group of "Else If" statements. The Array data I used was text, not numbers.
*************************
var sum = 0;
for (i=0; i<KeyArray.length; i++) {
sum++;
if (KeyArray=txtValue) {
break;
}
out = "The Sum Value is "+sum;
}
**************************
for (i=0; i<KeyArray.length; i++) {
if (KeyArray=txtValue) {
break;
}
out = KeyArray;
}
**************************
var sum = 0;
for (i=0; i<KeyArray.length; i++) {
x = KeyArray;
trace(x);
y = txtValue;
trace;
sum = Number(sum+1);
trace(sum);
if (x == y) {
break;
}
out = sum;
}
*************************
do {
i = i+1;
if (KeyArray == txtValue) {
break;
}
out = KeyArray;
} while (i<23);
****************************