I used to think that I added a listening event to an object and then removed it. Then, his event will not be executed. In fact, this is an error!
As3 is not Js. Its display, storage, and time listening are independent. It will not be deleted because you have deleted one of them!
If the addeventlistener of this object is not a function or method, removeeventlistener is required!
We need to understand that addchild is not equal to attachmovie, but it is actually two different things.
This is irrelevant to the weak reference. If you only use removechild, the MC will always occupy the memory, and all events will be executed. Flash regularly cleans up the unreferenced content. If the new variables have not been changed or deleted, they will always exist.
Therefore, after removechild (A), you should write another A = NULL statement to destroy this reference. In the end, this part of content will be automatically cleared.
Weak references refer to events. If you send an event to a and there is no removeeventlistener before deleting a, the event will always exist, even if a is deleted long ago. If the event is written as a weak reference, it will be automatically cleared by the system.