2 Replies Latest reply on Nov 11, 2008 7:54 AM by Gregory Lafrance

    Help with Lists

    Reevesp
      How do you read all of the list's data not just the selectedItem? I have 2 lists, List A is populated with an arrayCollection, List B is an empty list. Drag and drop is enabled for both. What I want to do is drag data from List A to List B and then save List B's data. I've tried several ways of doing this but so far no dice, anyone have a solution?
        • 1. Re: Help with Lists
          m_hartnett Level 3
          I am assuming that you already have the ListA to ListB drag and drop working and now you want to get all the children of ListB to save them to the database.

          First use numChildren to get the number of objects in the list. Then use the getChildAt method.

          for(var i:int = 0; i<list.numChildren;i++) {
          var obj : Object = list.getChildAt(i);
          //do whatever you want with the object
          }
          • 2. Re: Help with Lists
            Gregory Lafrance Level 6
            Associate an empty ArrayCollection or XMLListCollection with B and after the drag, access B.dataProvider.