tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/23-app-mediatorRobotlegs: Discussion 2018-10-18T16:35:07Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/7429582009-12-18T16:33:13Z2009-12-18T16:33:13ZApp-Mediator<div><p>Hello,</p>
<p>The MediatorMap will automatically create a Mediator instance
the context view as soon as you map it, provided that the view
class that you map to <em>is</em> the superclass of the context
view (the view that you passed to the context).</p>
<p>For example:</p>
<p>In your main application Sprite (main.as)</p>
<pre>
context = new MyContext( this );
</pre>
<p>And then in the context's startup():</p>
<pre>
mediatorMap.mapView( Main, MainMediator );
</pre>
<p>That would automatically create an instance of MainMediator -
because the context view (passed to the context) is an instance of
Main.</p>
<p>I think perhaps you have mapped things a little differently, but
it is hard to tell without more details (or some code samples).</p>
<p>Does that help?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/7429582009-12-18T20:50:10Z2009-12-18T20:50:14ZApp-Mediator<div><p>I think i missed something</p>
<p><strong>Main.as</strong></p>
<pre>
public function Main() {
context = new MyContext(this);
}
</pre>
<p><strong>MyContext.as</strong></p>
<pre>
override public function startup() : void {
mediatorMap.mapView(Main, ApplicationMediator);
mediatorMap.createMediator(contextView);
}
</pre>
<p>*The Problem:** The stage is empty - white screen! (But the
mediator is called).</p></div>Fabian