<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Removing duplicate items from an array using the Array.filter() method</title>
	<atom:link href="http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Mon, 13 Feb 2012 01:38:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: HQ</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-10008</link>
		<dc:creator>HQ</dc:creator>
		<pubDate>Thu, 29 Sep 2011 07:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-10008</guid>
		<description>Very nice example! Thank you very much!</description>
		<content:encoded><![CDATA[<p>Very nice example! Thank you very much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wagner</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-9477</link>
		<dc:creator>Wagner</dc:creator>
		<pubDate>Fri, 05 Aug 2011 20:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-9477</guid>
		<description>if I have 2 datagrids using the same array bindable. and I want the filter to be applied to only one of the datagrids. how?</description>
		<content:encoded><![CDATA[<p>if I have 2 datagrids using the same array bindable. and I want the filter to be applied to only one of the datagrids. how?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chinmaya</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-9363</link>
		<dc:creator>Chinmaya</dc:creator>
		<pubDate>Sat, 02 Jul 2011 09:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-9363</guid>
		<description>Nice example !!! Thanks !!!

@Priya: Use .refresh();</description>
		<content:encoded><![CDATA[<p>Nice example !!! Thanks !!!</p>
<p>@Priya: Use .refresh();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: priya</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-8185</link>
		<dc:creator>priya</dc:creator>
		<pubDate>Mon, 02 Aug 2010 11:58:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-8185</guid>
		<description>when I use above filter function for ArrayCollection along with Datagrid, upon click of sort functionality, datagrid is becoming empty. 
how to resolve this issue?</description>
		<content:encoded><![CDATA[<p>when I use above filter function for ArrayCollection along with Datagrid, upon click of sort functionality, datagrid is becoming empty.<br />
how to resolve this issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aviral Sharma</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-6827</link>
		<dc:creator>Aviral Sharma</dc:creator>
		<pubDate>Fri, 22 Jan 2010 00:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-6827</guid>
		<description>If you wanna use the filter function twice, you might wanna clear the keys object since it already has old values for second use.

 Snippet:
&lt;!-- Code Starts --&gt;
				keys={};
				var filterRoutes:Array = routesArray.filter(removedDuplicates);
				keys={};
				var filterDivisions:Array = divisionsArray.filter(removedDuplicates);
&lt;!-- Code Ends --&gt;</description>
		<content:encoded><![CDATA[<p>If you wanna use the filter function twice, you might wanna clear the keys object since it already has old values for second use.</p>
<p> Snippet:<br />
<!-- Code Starts --><br />
				keys={};<br />
				var filterRoutes:Array = routesArray.filter(removedDuplicates);<br />
				keys={};<br />
				var filterDivisions:Array = divisionsArray.filter(removedDuplicates);<br />
<!-- Code Ends --></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ixdl</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-6772</link>
		<dc:creator>ixdl</dc:creator>
		<pubDate>Thu, 14 Jan 2010 01:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-6772</guid>
		<description>Bob,
let&#039;s say you have an ArrayCollection AC with Strings S.
To make sure that each String is represented only once:

S=&quot;Bob&quot;;
if ( !AC.contains(S)) AC.addItem(S);</description>
		<content:encoded><![CDATA[<p>Bob,<br />
let&#8217;s say you have an ArrayCollection AC with Strings S.<br />
To make sure that each String is represented only once:</p>
<p>S=&#8221;Bob&#8221;;<br />
if ( !AC.contains(S)) AC.addItem(S);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-4996</link>
		<dc:creator>Yuri</dc:creator>
		<pubDate>Fri, 07 Aug 2009 13:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-4996</guid>
		<description>Thanks, man! That&#039;s what I needed here. Awesome!</description>
		<content:encoded><![CDATA[<p>Thanks, man! That&#8217;s what I needed here. Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-324</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Mon, 06 Aug 2007 18:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-324</guid>
		<description>Bob,

I believe it can.

Try something like this:

&lt;pre class=&quot;code&quot;&gt;
dedupedArrColl = new ArrayCollection(arr);
dedupedArrColl.filterFunction = removedDuplicates;
dedupedArrColl.refresh();
&lt;/pre&gt;

And then change the filtering function to this:
&lt;pre class=&quot;code&quot;&gt;
/** Note that the method has 1 parameter now instead of 3, the rest of the code can remain the same */
private function removedDuplicates(item:Object):Boolean {
   // ...
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Bob,</p>
<p>I believe it can.</p>
<p>Try something like this:</p>
<pre class="code">
dedupedArrColl = new ArrayCollection(arr);
dedupedArrColl.filterFunction = removedDuplicates;
dedupedArrColl.refresh();
</pre>
<p>And then change the filtering function to this:</p>
<pre class="code">
/** Note that the method has 1 parameter now instead of 3, the rest of the code can remain the same */
private function removedDuplicates(item:Object):Boolean {
   // ...
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-323</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Mon, 06 Aug 2007 17:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-323</guid>
		<description>Nice example! Can this be done with an ArrayCollection as well?</description>
		<content:encoded><![CDATA[<p>Nice example! Can this be done with an ArrayCollection as well?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FlexLover</title>
		<link>http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/comment-page-1/#comment-322</link>
		<dc:creator>FlexLover</dc:creator>
		<pubDate>Sun, 05 Aug 2007 21:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/05/removing-duplicate-items-from-an-array-using-the-arrayfilter-method/#comment-322</guid>
		<description>Tank&#039;you very much, this is the right example for me.</description>
		<content:encoded><![CDATA[<p>Tank&#8217;you very much, this is the right example for me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

