Hello,
 
first i must say that i do not agree with "I think that Adobe must provide this functionality", i personally never used this functionality and besides that, i dont think it should a part of the combobox itself. I mean, what if you want the same functionality for a listbox, datagrid or any other component.
 
But hey, you need it, so you make and better even: you shared it :)
 
I looked at your code and i would do it differently. Every time the selectedIndexData property is set you loop over the complete dataprovider, this is a quite expensive routine. It would be more smart to loop through the dataprovider once and map each object to an index. Something like this:
 
var dataField_str:String = "data";
var map_obj:Object = new Object();
var length_int:int = dataProvider.length;
var item_obj:Object;
var value:String;
 
while (length_int--)
{
   item_obj = dataProvider[length_int];
   value = item_obj[dataField_str];
   map_obj[value] = lenth_int;
};
 
This way you can find the index of an item without looping.
 
Lets say at some point you sort the dataProvider. If the dataProvider is wrapped into (lets say) an array collection. You can subscribe yourself to the appropriate change event and remake your map.
 
I hope this helps in any way.
 
 
Greetz Erik
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to