Search code examples
actionscript-3apache-flexsignalsrobotlegs

How to use robotlegs and signals without flex ie. pure as3


I'm try to put together a bare bones robotlegs-signals project but all the samples I've seen are flex ie

Index.mxml

 <context:SignalCafeContext contextView="{this}"/>

SignalCafeContext.as

public class SignalCafeContext extends SignalContext
  {
    override public function startup():void
    {  
        injector.mapSingleton.... etc etc
    }
}

Is this possible to replace the mxml with another .as file - normally I would pass from the main class

context = new MyContext(this); // where this is DisplayObjectContainer

however super() takes no parameters in SignalContext so I might be missing something.

More Info:

libs:

as3-signals-v0.5.swc

robotlegs-framework-v1.03.swc

signals-extensions-SignalsCommandMap.swc


Solution

  • What you're trying would work in the current RobotLegs v.1 release (v.1.5.2). Context and its subclass SignalContext take optional params. The first param is your context view:

    contextView:DisplayObjectContainer = null
    

    Here's the SignalContext class extending Context.
    Note, Context in Robotlegs 2 does not take parameters (source).