AS3 garbage collection and arrays

Hey guys,

I have a question about garbage collection in AS3. Let’s say that I create a simple class, Item and link a movieclip in my library to this class. Now, in my main program, I create an array of Item’s as follows:


var problemArray:Array = new Array();
function myTest()
{
var problemItem1:Item = new Item("test1");
var problemItem2:Item = new Item("test2");
var problemItem3:Item = new Item("test3");
            
problemItem1.addEventListener(ContactModeratorEvents.PROBLEM_SELECTED, onProblemSelected, false, 0, true);
problemItem2.addEventListener(ContactModeratorEvents.PROBLEM_SELECTED, onProblemSelected, false, 0, true);
problemItem3.addEventListener(ContactModeratorEvents.PROBLEM_SELECTED, onProblemSelected, false, 0, true);

problemArray["test1"] = problemItem1;
problemArray["test2"] = problemItem2;
problemArray["test3"] = problemItem3;

}

At this point, I have 3 references to 3 objects of type Item stored in this array. As I understand it, an object will only be deleted from memory if it has been marked for deletion. The only way an object can be marked for deletion is if the object no longer has any references to it. This brings me to my question:

If I do the following:

problemArray = null;

Have the three references in the array that point to the three objects been deleted??? I made sure to set weak referencing on the event listeners that I attached, so I would think they would be marked for garbage collection. I am used to working in C++ so I usually delete all of the items myself and use a destructor in my classes, but since flash uses the garbage collection, I can’t even seem to see what the reference count is to even know if my objects are marked for garbage collection. My thought is that an array is just a space in memory and if I set it to null, that space should be deleted, but I’m not sure if it is truly deleting these references or not. Please help!