MikeW
MikeW

Reputation: 4809

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

Upvotes: 0

Views: 845

Answers (3)

Marc H
Marc H

Reputation: 1248

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.

Upvotes: 0

EMebane
EMebane

Reputation: 56

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

Upvotes: 1

George Profenza
George Profenza

Reputation: 51837

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

Upvotes: 0

Related Questions