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