What error do you get?
[Fault] exception, information=Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.
This is the function where the error occurs:
override protected function createChildren():void
iconHolder = new UIComponent();
The function is in my spark.components.ComboBox extension class.
The error is pretty clear: use addElement() instead of addChild(). Spark ComboBox extends (probably) from Group which has addChild(), removeChild() and similar methods disabled: if you look in those methods in source code you will see that all of them just throw IllegalOperationError.
using addElement() gives
Error: Call to a possibly undefined method addElement
Sorry. My bad. SkinnableContainer is a superclass (not direct) of ComboBox component and it has those methods disabled.
Anyway, why do you even use those methods in ComboBox? Since ComboBox is one of different kinds of lists in Flex, adding an item to its data provider should be enough. Or is there something totally different you are trying to atchieve?
I was subclassing a spark comboBox to have an icon and a label, based on a subclass I had made of mx components.
I went another way with this, using skins, an example can be found here
Thanks all for your help + interest,