0

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

MikeW
  • 4,749
  • 9
  • 42
  • 83

3 Answers3

1

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).

Florent
  • 12,310
  • 10
  • 49
  • 58
EMebane
  • 56
  • 2
0

mxml tags are just shorthand for actionscript classes. So I'd imagine you could start by taking a look at the auto-generated actionscript code. There is a flash builder compiler option that will let you see this. Using that as a template, you probably can't go too far wrong.

Marc H
  • 1,228
  • 3
  • 18
  • 29
0

I imagine you need to start with a actionscript project instead of a flex project in FlashBuilder first.

Yes, your right, you just extend the Context class, as you can see in the basic HelloFlash robotlegs demo

George Profenza
  • 50,687
  • 19
  • 144
  • 218
  • I'm afraid this goes a fair way beyond the hello world robotlegs sample. I've built several apps using event dispatcher and robotlegs - the difference is SignalContext not Context. SignalContext accepts no parameters when you call super(). You need SignalContext to use signals not Context. So how do you create a new context from your main class using SignalContext? Remember super() accepts no parameters. – MikeW Feb 23 '12 at 10:45