Alex Rivera | Logout

Understanding Array::splice in ActionScript 3

Asked 2010-01-12T01:48:50.657
11

I am trying to remove an object from an array, but for some reason it's not working. I am under the impression that a splice accepts 2 parameters: first, the position in the array to begin at. And for parameter 2, how many to delete from then on out.

I just want to delete one entry so I am doing this:

array.splice(i,0);

But it isn't working. Can someone tell me what I am doing wrong and enlighten me on how it is supposed to work.

Edit
Report

1 Answer

40

If you want to remove one element, you call splice(index, 1).

answered 2010-01-12T01:50:53.833

Your Answer