Skip to content

Instantly share code, notes, and snippets.

@Ondina
Created November 3, 2011 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ondina/1336448 to your computer and use it in GitHub Desktop.
Save Ondina/1336448 to your computer and use it in GitHub Desktop.
ApplicationMediator (ViewNavigatorApplication)
package com.robotlegs.demos.robotlegsincremental.views.mediators
{
import com.robotlegs.demos.robotlegsincremental.controllers.events.NavigationEvent;
import org.robotlegs.mvcs.Mediator;
/**
*
* @author [Ondina D. F.]
*
*/
public class ApplicationMediator extends Mediator
{
[Inject]
public var view:ContextView;
override public function onRegister():void
{
eventMap.mapListener(view, NavigationEvent.ACTIVE_VIEW_CHANGED, onActiveViewChanged);
eventMap.mapListener(eventDispatcher, NavigationEvent.ACTIVE_VIEW_CHANGED, changeActiveView);
}
protected function onActiveViewChanged(event:NavigationEvent):void
{
trace("ApplicationMediator.onActiveViewChanged(event)" + event.viewClass);
}
protected function changeActiveView(event:NavigationEvent):void
{
view.changeActiveView(event.viewClass);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment