Removing value from array

Today I came across the problem that I had to remove an value from an array in actionscript. The thing is that it’s very well possible to remove a value at a certain index in the array, but not a value itself.

So, therefore I began searching for an answer … this is the solution I found …

Array.prototype.removeValue = function(string) {
for (i = 0; i < this.length; i++){
if (this[i] == string){
this.splice(i, 1);
}
}
}

myarr.removeValue(item);

It worked great :d …