Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
public class MyMediator extends Mediator { // Constructor public function get module():MyView { return viewComponent as MyView; } override public function listNotificationInterests():Array { return [MyFacade.DATA_RETRIEVAL_SUCCEEDED]; } override public function handleNotification(notification:INotification):void { switch(notification.getName()) { case MyFacade.DATA_RETRIEVAL_SUCCEEDED: var vo:MyVO = notification.getBody() as MyVO; module.processDataAndManipulateView(vo); break; } }}<mx:Application> <mx:Script> <![CDATA[ public function processDataAndManipulateView(vo:MyVO) { // Perform view specific logic with returned data } ]]> </mx:Script> <!-- your view components/controls go here --></mx:Application>
Mediators are only when a view component needs to communicate with the rest of the application in which case a Mediator should mediate those needs with the rest of the application via notifications. Otherwise a regular component class should suffice.Any confirmation/clarification would be great.