A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: clear objects in an array

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212

    clear objects in an array

    hi,

    how do I remove objects, in this case of the LoadingItem type loaded by Bulkloader from an array that I've put them in, so that they are being cleared from memory. It doesn't seem to be sufficient to use removeAll or even clear the bulkloeader instance,

    thanks,

    Jerryjj.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    array.splice(0, array.length);
    array = [];

    You can't remove objects from memory manually, the automatic garbage collector will do it after you remove all references to these objects (which also includes event listeners added to the objects and other stuff).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center