<?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: OT: Remove duplicate values in an array, AS3</title>
	<atom:link href="http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/</link>
	<description></description>
	<lastBuildDate>Mon, 12 Dec 2011 18:11:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Jan Jackque</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-166</link>
		<dc:creator>Jan Jackque</dc:creator>
		<pubDate>Mon, 12 Dec 2011 18:11:51 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-166</guid>
		<description>I have found the solution on how to find duplicates in array that to my mind is simplier:

 private function hasDuplicates(arr:Array):Boolean{
02	 
03	  var x:uint;
04	  var y:uint;
05	 
06	            for (x = 0; x &lt; arr.length ; x++){
07	 
08	                for (y = x + 1; y &lt; arr.length; y++){
09	 
10	                        if (arr[x] === arr[y]){
11	                            return true;
12	                        }
13	 
14	                }
15	            }
16	            return false;
17	    }


  Need to give a credit to author, i  found it here:

 http://myprogrammingblog.com/2011/12/12/actionscript-3-0-how-to-find-duplicate-array-elements-solved/</description>
		<content:encoded><![CDATA[<p>I have found the solution on how to find duplicates in array that to my mind is simplier:</p>
<p> private function hasDuplicates(arr:Array):Boolean{<br />
02<br />
03	  var x:uint;<br />
04	  var y:uint;<br />
05<br />
06	            for (x = 0; x &lt; arr.length ; x++){<br />
07<br />
08	                for (y = x + 1; y &lt; arr.length; y++){<br />
09<br />
10	                        if (arr[x] === arr[y]){<br />
11	                            return true;<br />
12	                        }<br />
13<br />
14	                }<br />
15	            }<br />
16	            return false;<br />
17	    }</p>
<p>  Need to give a credit to author, i  found it here:</p>
<p> <a href="http://myprogrammingblog.com/2011/12/12/actionscript-3-0-how-to-find-duplicate-array-elements-solved/" rel="nofollow">http://myprogrammingblog.com/2011/12/12/actionscript-3-0-how-to-find-duplicate-array-elements-solved/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AS3 script</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-162</link>
		<dc:creator>AS3 script</dc:creator>
		<pubDate>Fri, 29 Jul 2011 13:44:05 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-162</guid>
		<description>Hi, nice code.. like it :-)

actually I am trying to do same but little bit diff... I want unique value from array elements. I don&#039;t want to repeat those values having same starting character. 

var mainArr:Array = [&quot;cat&quot;,&quot;dog&quot;,&quot;chocolate&quot;,&quot;fire&quot;,&quot;food&quot;,&quot;house&quot;,&quot;market&quot;,&quot;butter&quot;,
								 &quot;fruit&quot;,&quot;ham&quot;,&quot;computer&quot;,&quot;door&quot;,&quot;hen&quot;]
// c,d,f,m,b,h = 6
removeDuplicate(mainArr);

function removeDuplicate(arr:Array) : void{
    var i:int;
    var j: int;
    for (i = 0; i &lt; arr.length; i++){
        for (j = i + 1; j &lt; arr.length; j++){
		if (arr[i].substr(0,1) == arr[j].substr(0,1)){
				arr.splice(j,1);
            }
        }
    }
	trace(arr)
	trace(arr.length)
}</description>
		<content:encoded><![CDATA[<p>Hi, nice code.. like it <img src='http://sub73.net/bikelog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>actually I am trying to do same but little bit diff&#8230; I want unique value from array elements. I don&#8217;t want to repeat those values having same starting character. </p>
<p>var mainArr:Array = ["cat","dog","chocolate","fire","food","house","market","butter",<br />
								 "fruit","ham","computer","door","hen"]<br />
// c,d,f,m,b,h = 6<br />
removeDuplicate(mainArr);</p>
<p>function removeDuplicate(arr:Array) : void{<br />
    var i:int;<br />
    var j: int;<br />
    for (i = 0; i &lt; arr.length; i++){<br />
        for (j = i + 1; j &lt; arr.length; j++){<br />
		if (arr[i].substr(0,1) == arr[j].substr(0,1)){<br />
				arr.splice(j,1);<br />
            }<br />
        }<br />
    }<br />
	trace(arr)<br />
	trace(arr.length)<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: as-flash</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-48</link>
		<dc:creator>as-flash</dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-48</guid>
		<description>Thank you too for example of using array.some() ;)</description>
		<content:encoded><![CDATA[<p>Thank you too for example of using array.some() <img src='http://sub73.net/bikelog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-47</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:46:02 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-47</guid>
		<description>Haven&#039;t tested it, but I&#039;m sure you&#039;re right - thanks!

Neil</description>
		<content:encoded><![CDATA[<p>Haven&#8217;t tested it, but I&#8217;m sure you&#8217;re right &#8211; thanks!</p>
<p>Neil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: as-flash</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-46</link>
		<dc:creator>as-flash</dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-46</guid>
		<description>May be below code would be more simple and clear:

var originalArray:Array = new Array(&quot;yellow&quot;, &quot;red&quot;, &quot;blue&quot;, &quot;red&quot;, &quot;yellow&quot;, &quot;green&quot;, &quot;yellow&quot;, &quot;purple&quot;, &quot;ginger&quot;, &quot;red&quot;, &quot;blue&quot;);

var dedupedArray:Array = new Array();

function ArrayTest() 
{
 for each (var colour:String in originalArray)
 {
  if (dedupedArray.indexOf(colour)===-1)
  {
   dedupedArray.push(colour);
  }
 }
 trace(&quot;dedupedArray: &quot;+dedupedArray);
}

ArrayTest();</description>
		<content:encoded><![CDATA[<p>May be below code would be more simple and clear:</p>
<p>var originalArray:Array = new Array(&#8220;yellow&#8221;, &#8220;red&#8221;, &#8220;blue&#8221;, &#8220;red&#8221;, &#8220;yellow&#8221;, &#8220;green&#8221;, &#8220;yellow&#8221;, &#8220;purple&#8221;, &#8220;ginger&#8221;, &#8220;red&#8221;, &#8220;blue&#8221;);</p>
<p>var dedupedArray:Array = new Array();</p>
<p>function ArrayTest()<br />
{<br />
 for each (var colour:String in originalArray)<br />
 {<br />
  if (dedupedArray.indexOf(colour)===-1)<br />
  {<br />
   dedupedArray.push(colour);<br />
  }<br />
 }<br />
 trace(&#8220;dedupedArray: &#8220;+dedupedArray);<br />
}</p>
<p>ArrayTest();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-44</link>
		<dc:creator>Jacob</dc:creator>
		<pubDate>Fri, 18 Sep 2009 18:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-44</guid>
		<description>I can&#039;t believe you figured that out!
Nice job man. I didn&#039;t think anyone could do it!</description>
		<content:encoded><![CDATA[<p>I can&#8217;t believe you figured that out!<br />
Nice job man. I didn&#8217;t think anyone could do it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: puelogames</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-25</link>
		<dc:creator>puelogames</dc:creator>
		<pubDate>Mon, 16 Feb 2009 13:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-25</guid>
		<description>works perfect!!!</description>
		<content:encoded><![CDATA[<p>works perfect!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://sub73.net/bikelog/2008/ot-how-to-remove-duplicate-values-in-an-array-actionscript-3/comment-page-1/#comment-24</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Fri, 16 Jan 2009 00:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://sub73.net/bikelog/?p=72#comment-24</guid>
		<description>THANKS YOU SOO MUCH!!!! 
I don&#039;t 100% understand this but it works, ill have to study it a bit more, again thanks so much i did a bit of googling to find you!</description>
		<content:encoded><![CDATA[<p>THANKS YOU SOO MUCH!!!!<br />
I don&#8217;t 100% understand this but it works, ill have to study it a bit more, again thanks so much i did a bit of googling to find you!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

