Add this simple override to your application’s Context:
override protected function get mediatorMap():IMediatorMap
{
return _mediatorMap || (_mediatorMap = new MultiWindowFlexMediatorMap(contextView, injector.createChild(), reflector));
}
When you create a new IWindow (Spark or MX), create its mediator manually:
package com.example
{
import com.example.view.components.ExampleWindow;
import org.robotlegs.mvcs.Command;
public class CreateExampleWindowCommand extends Command
{
override public function execute():void
{
var ExampleWindow = new ExampleWindow();
this.mediatorMap.createMediator(window);
window.open();
}
}
}
Now the window should be treated just like a contextView by the MediatorMap so that new children automatically get mediators.