18Jun

Erasing All Items in an Array with Slice Method

No comments

Because I occasionally build arrays with the push method, there was an occurrence where I need to wipe it out entirely. I was able to do so with the Slice Method. It is simply:

myArray.slice ( 0 );

The parameter of 0 will wipe out all items after the first element of your array. It will accept a second parameter which will act as a delimeter for clearing items, -1 value will be the last item in the Array.

Share/Save/Bookmark

Categories: Actionscript 3, Arrays

Wednesday, June 18th, 2008 at 9:50 am and is filed under Actionscript 3, Arrays. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply