Skip to content


Flex Tip: ArrayCollection replace an item with setItemAt

One thing which might not be clear when working with ArrayCollections in Flex is how to replace an item in the collection.  The methods getItemAt and addItemAt are pretty clear in their purpose, but one method which I found myself over looking is the setItemAt method which could be more aptly named replaceItemAt as that is exactly what it does.  It replaces an item in the collection.

So next time you’re looking to replace an item in an ArrayCollection and wishing there was a replaceItemAt method, look no further than setItemAt

Posted in Actionscript, Code.

Tagged with , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



close