all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

remove duplicates from array


Re: remove duplicates from array Jack
9/22/2004 8:30:44 PM
flash actionscript:

[quoted text, click to view]

myArray = new Array(1, 9, 15, 23, 9, 15, 17, 22, 9, 1);
trace ("BEFORE -- myArray: "+myArray);
for (inc0=0; inc0<myArray.length-1; inc0++) {
for (inc1=inc0+1; inc1<myArray.length; inc1++) {
if (myArray[inc0] == myArray[inc1]) {
myArray.splice(inc1--, 1);
}
}
}
trace ("AFTER -- myArray: "+myArray);

hth

remove duplicates from array ELVIS
9/22/2004 10:10:43 PM
Dear friends

I have an xml file which i convert into an array

I want to write a function to get back all the values of one index of that
array
and add them in a listbox. I know how to do that
and i am ok.
But....
that index i am interested in, has many dublicates.

Does anybody knows how i can get all the values of that index
without dublicates ???

thanxs in advance for any help

AddThis Social Bookmark Button