I bet it's some named law that an explanation presents itself right after you have left all hope and posted a public cry for help.
In case the UIComponent is part of a Flex Module, it is the module itself that dispatches the FlexEvent.REMOVE, since it is the hierarchically topmost element that gets removed. Now this makes sense at least, although how to propagate this knowledge of removal down to the component that I need, still needs solving. vx ----- Original Message ---- From: mrvx23 <[EMAIL PROTECTED]> To: [email protected] Sent: Thursday, May 1, 2008 5:59:22 PM Subject: [flexcoders] Flex3 UIComponents not dispatching add&remove events when loaded within Modules I ran across this anomaly and wonder if anyone else has encountered it and what a possible solution would be. I am trying to create a scenario whereby when a UIComponent becomes visible (loaded as part of a (application) viewstate change), it registers listeners to certain events, and when it becomes invisible (the viewstate changes so it is not in the active view anymore), it unregisters those listeners. This works all and well with the add and remove attributes for a given UIComponent mxml definition, _except_ when that component is dynamically loaded into the application in the content of a mx:Module. For some reason, the events (mx.events.FlexEven t.ADD and mx.events.FlexEvent .REMOVE) are either never dispatched or never received by the handler in the very same UIComponent subclass that changes visibility and registers the listener. Any explanation or suggestion on how to detect UIComponent visibility (to the user) in this case would be really appreciated, thanks, vx ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

