In Flex, the best practice when using a addEventListener
was to call removeEventListener
to avoid memory leak and/or event to be called twice if component could be created many times (like popups)
So addEventListener
was mainly used in addedToStage
event function and removeEventListener
was in removedFromStage
event function
What is the best practice for Apache Royale ?
It seem that addEventListener
should be in a initComplete
event. But as Apache Royale component life cycle is not very clear for me, does I need to take care of calling removeEventListener
, and if yes when (with a specific event ?) ?
Regards