I'm trying to make a flexible list using <mx:List> component, I mean when I add an item or if the item size is changed (ex: collapse/expand) the list size must change.
Is there an easy way to do that ? If you have any idea, please don't hesitate to post it here. Thanks in advance.
It sounds like you're doing 2 distinct things; 1) adding new items to the dataProvider, 2) The item renderer is expanding or collapsing.
If that is the case: 1) when you add an item to the dataProvider, increase the size of the list, 2) when the item renderer is expanding or collapsing, access the list through the "owner" property of the item renderer to change the size of the list.