Joe's Blog

line

A blog by Joe Billman about programming, and other stuff

line

Archive for October, 2011

Remove Duplicates from an Array AS3

Posted on: October 28th, 2011 by Joe

line 2 Comments

I recently needed function that would remove duplicate values from an array. After looking around online and modifying what I found to fit my needs I came up with the following:

var arr:Array = ["a", "b", "c", "a", "d", "a", "a"];

removeDuplicates(arr);

trace(arr);

function removeDuplicates(target:Array):void
{
	for(var i:uint=target.length; i>0; i--)
	{
		if(target.indexOf(target[i-1]) != i-1)
		{
			target.splice(i-1, 1);
		}
	}
}

If you are searching for a way to do this, I hope this helps!

Let Me Explain

Posted on: October 12th, 2011 by Joe

line No Comments

So if you’ve read the previous posts on my blog you might be wondering what’s going on. Before abandoning it, please know that I’m still going to blog about cool programming and graphic design stuff, but now and then I’m going to add some cool quotes and yummy recipes. After all any good programmer or graphic designer needs to hear some awesome quotes and definitely needs to eat some delicious treats. Oh and to make up for the treats I might every now and again throw in one about nutrition or exercise.

Good Enough

Posted on: October 12th, 2011 by Joe

line No Comments

“Art is never finished, only abandoned.”

-Leonardo da Vinci

Preparation

Posted on: October 12th, 2011 by Joe

line No Comments

“Give me six hours to chop down a tree, and I will spend the first four sharpening the axe.”

– Abraham Lincoln

Use Your Talents

Posted on: October 12th, 2011 by Joe

line No Comments

“Your talent is God’s gift to you. What you do with it is your gift to God.”

-Leo Buscaglia


Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /homepages/16/d145171736/htdocs/php/footer.php on line 1