How can I remove / clear items out of a list control in Flex?

I have a list control in Flex that has been data bound to an e4x xml object from an HTTPService.

I would now like to have a button that clears the list, how can I do this?

I have tried:


list.dataProvider = null;

which does not seem to work, I have also tried:


list.dataProvider = {};

which clears the items but leaves [object,object] as the first item in the list...

Answers


Perhaps...

list.dataProvider = new Array();

Need Your Help

Javascript reads previously opening tab html on the save Window

javascript ajax

I have a task that i do not know where to start, i hope Stack Overflowers can give me some ideas.

CurrentAppSimulator.RequestProductPurchaseAsync purchasing simulation

microsoft-metro windows-store

I am trying to implement in-app purchase for my Windows Store App (Metro App). I was referring to the code samples here, but when I triggered the RequestProductPurchaseAsync method nothing happens....