Does removeChild clear the associated event listener related to those childs?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not by default — the final parameter of addEventListener is
useWeakReferences:Boolean = false. If that is set to true, the listener should clean up when the object leaves the stage. It does not always work as cleanly as that though.It is best, if possible, to remove all listeners manually before removing an object from the stage. That way you can probably get garbage collection to take it. If you miss it or forget, then it is possible that Flash will forgive you, but it is also possible that it will initiate a blood feud which makes the Hatfields and McCoy’s blush (Well, it can at least cause a headache).