Dynamic populate ComboBox (Flex)

Posted by Vinzcent on Stack Overflow See other posts from Stack Overflow or by Vinzcent
Published on 2010-03-27T12:54:11Z Indexed on 2010/03/27 15:33 UTC
Read the original article Hit count: 223

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about flex

Related posts about as3