I’m confused about the removeEventListener and removeChild functions. Doesn’t removeChild remove everything about that instance from the Stage? Or do I have to first remove the eventListener and then remove the object?
I ask because I’m not sure how to do this effeciently when working with xml and multiple buttons. Lets say I have an xml, with multiple slideshows seperated into different nodes. As a user chooses a slideshow, thumbnails get populated into a Sprite and I attach an “addEventListener” to each thumbnail in that sprite. Now when then user clicks to see a new slideshow, I just simply removeChild that sprite with all the thumbnails and create another one and repopulate it.
However, from reading around it seems like I have to loop through all the thumbnails first and remove the Event Listener and then delete each thumbnail and then delete the Sprite?? That’s crazy!
Taking it up one more level, what if I create my own class in that class I added some eventListeners. Then on my main stage, I make an instance of it and then later on want to kill it - do I now have to remove the event listeners inside that instance before removing it?
To me this seems really crazy as I could have classes extending into each other with lots of eventListener’s in between. How do I know what to do with all this?