You could prevent duplicates from being placed into the array in the first place. Or
http://proto.layer51.com/d.aspx?f=1196 You could rewrite a prototype as a regular function that takes the array as an argument. - eric On 5/22/07, Allandt Bik-Elliott (Receptacle) <[EMAIL PROTECTED]> wrote:
hi guys i'm looking for a way of removing duplicate items in an array i've done this so far //sort array so all items of the same content are grouped together myArray.sort(); //loop through items, removing any sitting next to a duplicate for (var i:Number = 0; i < myArray.length; i++) { if (myArray[i] == myArray[i+1]) { myArray.splice (i, 1); } } however, i always seems to end up with the first 2 items in the array being the same (although it works well after that) i can't figure out why - hope you can help obie _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com