1) I load the variables from an external as file, the variables are loaded with an #include line, I just try making a delay to see if maybe variables are not loading yet, nothing change.
2) My Combobox name is "product", I change the name in the relevant parts in your script
Code:
Array.prototype.findIndex = function(whichItem:String):Number
{
var ret_value = "value not found";
for(var i in this)
{
if(this[i] == whichItem)
{
ret_value = i;
trace(i)
}
}
return ret_value;
};
trace("Index: " + product.labels.findIndex(MiValor));
function EscribeEsto(){
MiValor = MiValor + chr(Key.getCode());
product.selectedIndex = findIndex(product.label, MiValor);
product.open();
product.text = MiValor;
}
product.addEventListener("keyDown",EscribeEsto);
I'm trying the following: when the Combobox (product) is in focus and the client types in his keyboard I want the text from the Combobox (MiValor) to show the typed text and my options scrolls automatic until the option that is the most similar (by A-B-C) to the typed text.