Dynamic populate ComboBox (Flex)
- by Vinzcent
Hey,
I want to populate a ComboBox after a clicked a button.
This is my code:
var dpNames:ArrayCollection = new ArrayCollection();
for each(var ca:Categorie in arrCategories)
{
dpNames.addItem ({label: ca.name, data: ca.value});
}
cbWijzigCategorie.dataProvider = dpNames;
But when he executes the last line, I alwas get the following error:
TypeError: Error #1009: Cannot access
a property or method of a null object
reference.
I have no idea why.
Thanks a lot,
Vincent