Hello there. I have this function, searchCout:
var array:Array = [“a”, “b”, “c”, “a”, “3”, “c”, “7”, “q”, “q”, “1”, “3”, “c”, “c”];
function searchCount(wor, arr){
var counter = 0;
for(i=0; i<arr.length; i+=1){
if(arr*==wor){
counter+=1;
}
}
return counter;
}
for (k=0; k<array.length; k++) {
trace(k+"="+searchCount(array[k], array));
}
And I have this little problem. In my scenario I have 2 arrays itemArray and quantityArray. The problem is like this. I call this function and verifie if I have the same elements in itemArray, if so I add the number of the same elements in the quantityArray, in his position. How can I do that? Eny sugestions?
Thank you.