Hello all,
I wrote a method to return the unique elements of an array:
Array.prototype.unique = function () {
o = [];
for (i in this) {
d = 0;
for (j in o) {
if (o[j] == this[i]) {
d++;
}
}
if (d < 1) o.push(this[i]);
}
return o.reverse();
}
ASSetPropFlags(Array.prototype, null, 1);
trace ([1, 2, 2].unique()); // gives "1,2"
Timo