Using Signals with RobotLegs 2

samac1068's Avatar

samac1068

01 Apr, 2013 07:06 PM

I'm not a much of a quick study as most of the people who are using Robotlegs, and I tend to get something to work, and usually stay continue using that same method from project to project. Well, I have an opportunity to upgrade an existing project and I thought I would go all the way, using SDK 4.6 and Robotleg 2 with Signals.

I started my "standard" setup and immediately ran into a problem with my Context page. Normally, I would setup my Context (using Robotlegs 1) using the following:

package com.rl
{
    import com.rl.controllers.LoadXMLCommand;
    import com.rl.controllers.StartUpCommand;

    import flash.display.DisplayObjectContainer;

    import org.robotlegs.base.ContextEvent;

    import org.robotlegs.mvcs.SignalContext;

    public class FTNContext extends SignalContext
    {
        public function FTNContext(contextView:DisplayObjectContainer = null, autoStartup:Boolean = true)
        {
            super(contextView, autoStartup);
        }

        override public function startup():void
        {
            commandMap.mapEvent(ContextEvent.STARTUP, StartUpCommand, ContextEvent, true);
            commandMap.mapEvent(ContextEvent.STARTUP_COMPLETE, LoadXMLCommand, ContextEvent, true);

            dispatchEvent(new ContextEvent(ContextEvent.STARTUP));
            dispatchEvent(new ContextEvent(ContextEvent.STARTUP_COMPLETE));
        }
    }
}

This has been working perfectly and I've have an understanding of what is going on.....for the most part. Anyway, now I've moved to 4.6 and RL2, and when I attempt to using the format I get the error. My error exists here:

public function FTNContext(contextView:DisplayObjectContainer = null, autoStartup:Boolean = true)
{
       super(contextView, autoStartup); ///<--- Invalid Number of parameters, expecting 0
}

On my MXML page, I am bootstrapping the page in my declaration:

<fx:Declarations>
        <local:FTNContext contextView="{this}" />
</fx:Declarations>

I'm at a loss as to why I am having problems. I plan on returning back to RL1, just to get my project moving. Maybe I modified the original RL code to deal with this, but I doubt it. I rarely screw with code that is working.

Can anyone provide a suggestion as to what I am missing, or a way I can correct this problem. Thank you in advance.

  1. Support Staff 1 Posted by Shaun Smith on 01 Apr, 2013 07:17 PM

    Shaun Smith's Avatar

    Hi,

    RL2 has a very different setup mechanism to RL1. You no longer need to extend the Context class. Instead you instantiate the standard Context and add configuration to it. The readme on this page should get you up and running:

    https://github.com/robotlegs/robotlegs-framework

    To use signals you should install the SignalCommandMap extension:

    https://github.com/pixels4nickels/robotlegs-extensions-SignalComman...

  2. 2 Posted by samac1068 on 01 Apr, 2013 07:19 PM

    samac1068's Avatar

    Thanks a lot Shaun. I figured it was something I didn't take into consideration, like reading.

  3. Support Staff 3 Posted by Shaun Smith on 01 Apr, 2013 07:21 PM

    Shaun Smith's Avatar

    Haha, yes things are quite different.. you might need to do a fair bit of reading.

  4. samac1068 closed this discussion on 01 Apr, 2013 07:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac