You can easily have the mediator not respond to the note if the view component isn't shown.How? By checking the 'visible' property of the viewComponent before handling a notification in handleNotification?
override public function handleNotification( note:INotification ):void
if ( ! rolePanel.visible ) return;
switch ( note.getName() )
rolePanel.userRoles = roleProxy.getUserRoles( rolePanel.user.username );
How would the above scheme deal with UI components which utilize a timer to continuously send out events to the mediator?
This scheme is only concerned with turning away inbound notifications, it doesn't have any intersection at all with outbound events coming from the component. Those are handled in event handlers the mediator has placed on the component. But the same scheme can apply there as well:
private function onRecurringEvent( event:Event ):void
if (! rolePanel.visible ) return;
roleProxy.addRoleToUser( rolePanel.user, rolePanel.selectedRole );
Basically you're just ignoring communications requests to or from the component when it is invisible. No biggie. If you need a more complex adaptation of mediator behavior to view component state, then you want to implement view states in the component. This is built into Flex but can be built manually in a Flash component. In any case you'd be looking at the currentState property of the component and moderating communications based on that state. This gives you more than the two states of visible/hidden.