Don't you access properties in an XMLListCollection differently than in an 
ArrayCollection?

So rather than...
var item:String = dataProv.getItemAt(i).dpID;
it would be
var item:String = dataProv.getItemAt(i)....@dpid;

Try doing a debug of your code and see what is being returned also.

--- In [email protected], Angelo Anolin <angelo_ano...@...> wrote:
>
> Hi FlexCoders,
> 
> I would want to create a generic function to be able to set a ComboBox item.
> 
> The function I have goes like this:
> 
> private function selectComboItem(itemID:String, dataProv:XMLListCollection, 
> cmb:ComboBox, dpID:String) :void
> {
>   for (var i:int = 0; i< dataProv.length; i++)
>   {
>     var item:String = dataProv.getItemAt(i).dpID;
> 
>     if(itemID == item)
>     {
>       cmb.selectedIndex = i;
>       break;
>     }
>   }
> }
> 
> dpID is the data item in the XML List collection which should match the 
> passed itemID.  But I can't seem to get properly the item.
> 
> Any suggestions highly appreciated. Thanks.
>


Reply via email to