Search code examples
flashactionscript-3actionscriptflash-cs4

Understanding Array::splice in ActionScript 3


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.


Solution

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