Difference between Array and ArrayCollection(Flex)

此生再无相见时 提交于 2019-12-07 00:02:35

问题


What's the difference between array and arraycollection?


回答1:


First, the ArrayCollection is designed for the Flex framework. It acts like a Proxy for a given Array instance. This means it can listen for modifications made to the source Array and update it self when this happens. It also contains a subset of additional methods required specifically by the framework (have a look at the IList implementation for instance).




回答2:


One important difference is that ArrayCollection raises events whenever it is modified. This allows you to do data binding on it more effectively than you could do on an Array.




回答3:


An ArrayCollection is a wrapper for an Array that lets it be used by GUI elements. Iterating through them is a bit tricky however, see here: http://npcomplete.weebly.com/1/post/2009/10/for-loops-in-actionscript.html



来源:https://stackoverflow.com/questions/2308730/difference-between-array-and-arraycollectionflex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!