2 Replies Latest reply on Dec 5, 2011 9:02 AM by hincauti

    Actionscript 3.0 ArrayCollection issue!!


      Hi there, in my mobile application I'm using an ArrayCollection to populate a list with a custom itemRenderer which includes a RadioButton. Now, when I click on the list items I'd like that the RadioButton selected property to be set to true. When I click another item, the previous RadioButton selected property to be false and the current set to true. I did the first part, I was able to set the selected property to true when the item is clicked but couldn't change it back when another item in the list is selected. Here is my Code:


      public var profileArray:ArrayCollection = new ArrayCollection([
          {entries:"1", name:"Guest", isSelected:"false"},
          {entries:"2", name:"Name1", isSelected:"false"},
          {entries:"3", name:"Name2", isSelected:"false"}

      in order to enable the radioButton id used the fallowing code:

      var currentlySelectedItem:Object = ProfileList.selectedItem;
      currentlySelectedItem.isSelected = true;


      and then pass the profileArray isSelected (true or false) property to the radioButton "selected" property.


      I don't know how to reset the "isSelected" proeprty to false for all item in the profileArray array collection.


      Please Help!


      Thank you