Hi there, I want to compare two arraycollection and take the different items out. I tried using contains() method to check if the first item of arraycollection arrayControl is in arraycollection arrayColPref, but it just doesn't work. I mean, it is supposed to say "True" instead of "False". So, here's my code. Please show me where I did it wrong.
[Bindable] public var arrayControl:ArrayCollection = new ArrayCollection([{name:"Message", data:"colMessage"}, {name:"Assigned to", data:"colAssignedto"}, {name:"Start date", data:"colStartdate"}, {name:"Due date", data:"colDuedate"}, {name:"Status", data:"colStatus"}, {name:"Priority", data:"colPriority"}, {name:"Posted by", data:"colPostedby"}]); [Bindable] public var arrayColPref:ArrayCollection = new ArrayCollection([{name:"Message", data:"colMessage"}, {name:"Priority", data:"colPriority"}, {name:"Assigned to", data:"colAssignedto"}, {name:"Status", data:"colStatus"}]); public function isDuplicate():void { var bool:Boolean = arrayColPref.contains(arrayControl.getItemAt(0)); Alert.show(String(bool)); }