Chapter 5. The Robotlegs context in action
Every Robotlegs project begins with a context. Until the context is
instantiated, Robotlegs isn’t up and
running. To get your Robotlegs application going, you have to do two things:
provide the context with a contextView and ask it to run startup.
Provide the context with a root-view
Every Robotlegs application requires a root-view—an instance of
DisplayObjectContainer—which is the view
that will be provided to the mediatorMap, so that when child views are
added to this root-view they can be automatically mediated (an instance of
their mediator is created and provided with the child view that it
mediates for).
Tip
If your application is non-visual then just provide any-old
placeholder instance of Sprite or DisplayObjectContainer.
public class mosaictool extends Sprite
{
protected var _context:MosaicContext;
public function mosaictool()
{
_context = new MosaicContext(this);
}
...<WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns="library://ns.adobe.com/flex/spark" xmlns:kanban="robotlegs.examples.kanban.*" xmlns:view="robotlegs.examples.kanban.view.*" showStatusBar="false"> <fx:Style source="css/style.css"/> <fx:Declarations> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access