well isn't that interesting.  Wonder why that is.  I wish things were 
consistent.

I guess I could normalize things by looping over the array and creating a new 
array array of literal objects.

What I have is an array of objects coming from a cold fusion query so those 
objects will be consistent.  My Flex users will be adding to and subtracting 
objects from it.  .  I'll be creating new objects on the fly so I should be 
able to create the objects the same way (maybe use a simple class) and get 
things right.

I really like the idea of using the bytearray -- i hate the idea of flattening 
the objects into strings.  Too many things can go wrong with that


  ----- Original Message ----- 
  From: Oleg Sivokon 
  To: [email protected] 
  Sent: Thursday, July 01, 2010 4:19 PM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects


    

  Woops, sorry, it appears that objects created using new Object syntax are 
sorted differently from objects created using literal...


  var o:Object = new Object();
                        o.bar = "345";
                        o.foo = "123";
                        var result:Array = this.removeDuplicates(
                        [
                                { foo:"123", bar:"345" },
                                { foo:"123", bar:"345", foobar:"789" },
                                { foo:"123", bar:"347" },
                                { foo:"123", bar:345 },
                                { bar:"345", foo:"123" }, o
                        ]);


  So, my code won't work in that case... well whoops...

  

Reply via email to