Unique records in AS3
Tuesday, June 16th, 2009 @ 2:12 PM
I'm sure others already know this little trick - but in case you didn't...
The filtermethod for Arrays in Actionscript 3.0 comes in handy if you want to (ahem) *filter* certain elements out of your array :
var tmpArray:Array = ["oranges", "apples","oranges", "pineapple", "carrots", "oranges"];
var fruits:Array = tmpArray.filter(function(e, i, a){
var isUnique:Boolean = (a.indexOf(e) == i);
return (isUnique);
}, this);
trace(fruits.toString());
2 comments. continue reading...

Reading