2 Replies Latest reply on May 13, 2011 1:34 AM by alinhawaii

    xmllistcollection vs arraycollection

    alinhawaii

      When would using an xmllistcollection over an arraycollection make sense  ?  Since the arraycollection brings in the xml, why bother with the  xmllistcollection?

        • 1. Re: xmllistcollection vs arraycollection
          Flex harUI Adobe Employee

          I'm not sure what you mean by "brings in the xml".  If you have XML, any

          query of it results in an XMLList which you can use in an XMLListCollection

          without further conversion.

          • 2. Re: xmllistcollection vs arraycollection
            alinhawaii Level 1

            Yes I meant query.  By' bringing it in' I mean it's bringing in an actionscript object.

            So any query including using an arrayList (like the following) would be converted to an XMLlist?

            I thought arrayLists are separate from XMLLists.

             

              <fx:Declarations>
                <fx:Model id="categoryModel" source="data/categories.xml"/>
                <s:ArrayList id="categoryCollection" source="{categoryModel.category}"/>
              </fx:Declarations>

              <mx:DataGrid id="categoryGrid" dataProvider="{categoryCollection}"/>

             

            In any case I'm still not sure why you would need to use an XMLCollection since you can use an ArrayCollection.