Removing duplicates from an array doesn't work

I’ve been trying to remove duplicates from an array for a while, or even preventing them, and I’m having nothing but trouble.

There’s a lot of code to go through… so let me just paste some snippets and hopefully it will help.

I’m creating an array with objects inside it like so…

private function getJsonResult(event:Event):void {
	//ta.text+=http.lastResult;
	var JSONResArr:String = String(http.lastResult);	
	var obj:Object = JSON.decode(JSONResArr);
	
	//alertMe(String(obj.ResultSet.Result));
	for(var i:int=0;i<getLength(obj.ResultSet.Result);i++) {
		if (obj.ResultSet.Result*.Address == "") {
			delete obj.ResultSet.Result*;
		} else if(businessSites.selectedValue == 0 && obj.ResultSet.Result*.BusinessUrl == "") {
			delete obj.ResultSet.Result*;	
		} else {
			delete obj.ResultSet.Result*.Latitude;
			delete obj.ResultSet.Result*.Longitude;
			delete obj.ResultSet.Result*.Rating;
			delete obj.ResultSet.Result*.Distance;
			delete obj.ResultSet.Result*.Url;
			delete obj.ResultSet.Result*.ClickUrl;
			delete obj.ResultSet.Result*.MapUrl;
			delete obj.ResultSet.Result*.Categories;
			delete obj.ResultSet.Result*.id;
			delete obj.ResultSet.Result*.BusinessClickUrl;
			if (businessSites.selectedValue == 2) {
				if (obj.ResultSet.Result*.BusinessUrl) {
					if (dpArray.indexOf(obj.ResultSet.Result*) < 0) {
						dpArray.push(obj.ResultSet.Result*);	
					}
				}
			} else {
				if (dpArray.indexOf(obj.ResultSet.Result*) < 0) {
					dpArray.push(obj.ResultSet.Result*);	
				}
			}
		}
		dg.dataProvider = dpArray;  
	}
}

You can ignore all the different delete statements as they don’t really have anything to do with what we’re trying to do.

I’ve attempted to do an indexOf search to see if the array has something like the current object in it already, but exact duplicates get added anyway.

Then, I’ve tried a few “remove duplicates” functions I’ve found online, and none of them have worked.

Perhaps I need to kill the idea of using objects, and just stick with strings here?

That sounds like it’d be a little overkill, but if it works, it might have to be what I do.

Do you have any ideas on how I can get this to work?