Context error 1136: Incorrect Number of Arguments. Expected 0?

ndcollins's Avatar


29 Mar, 2010 08:37 AM

I have a Flash Professional project that I am attempting to use Robotlegs 1.0.3 with. When I instantiate the context, however, I get the error that there is an incorrect number of arguments, and that the expected number is 0. Why is that?

The same SWCs work fine when used with MXML.

I have created the project in Flash Builder 4.

  1. 1 Posted by Jason Dias on 29 Mar, 2010 08:42 AM

    Jason Dias's Avatar

    What parameters are you passing when creating the context? Make sure your context is extending Context.

    Can you post any code snippets?

  2. 2 Posted by ndcollins on 29 Mar, 2010 01:41 PM

    ndcollins's Avatar

    I am extending Context, and my looks like the following:

        import flash.display.Sprite;
        public class Main extends Sprite {
            protected var context:AppContext;
            public function Main() {
                context = new AppContext( this );
  3. Support Staff 3 Posted by Shaun Smith on 29 Mar, 2010 04:20 PM

    Shaun Smith's Avatar

    The Flash Professional compiler strips out metadata needed for Robotlegs to function correctly. There are some workarounds. SwiftSuspenders can use an XML definition for the predefined Robotlegs MVCS dependencies. Any custom dependencies need to either be defined for constructor injection, or included in the XML map (passed through to the context). There's an article with some more info over here:

  4. Support Staff 4 Posted by Shaun Smith on 29 Mar, 2010 04:22 PM

    Shaun Smith's Avatar

    Apologies, I messed up my first response (edited now).

  5. Stray closed this discussion on 16 Feb, 2011 09:04 PM.

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

Keyboard shortcuts


? 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