Hello Flash demo.

David Cox's Avatar

David Cox

26 Nov, 2009 04:55 PM

Hi there,

Trying to investigate RobotLegs (it looks very promising), but I can’t get your Hello Flash demo to compile. I simply started up a new ActionScript project in Flex, added your source files and compiled the HelloFlash.as class to generate this error. I think the null object reference is the dispatcher property of the EventMap class. As this is the first demo I've used, it's possible I've mucked something up and I don't really know where to begin in terms of debugging this. The stack trace is pasted below.

Any ideas what could be wrong?

Many thanks in advance.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

            at org.robotlegs.base::EventMap/mapListener()[F:\_flex\HelloRobotLegs\src\org\robotlegs\base\EventMap.as:102]
            at org.robotlegs.demos.helloflash.view::ReadoutMediator/onRegister()[F:\_flex\HelloRobotLegs\src\org\robotlegs\demos\helloflash\view\ReadoutMediator.as:46]
            at org.robotlegs.base::MediatorBase/preRegister()[F:\_flex\HelloRobotLegs\src\org\robotlegs\base\MediatorBase.as:66]
            at org.robotlegs.base::MediatorMap/registerMediator()[F:\_flex\HelloRobotLegs\src\org\robotlegs\base\MediatorMap.as:139]
            at org.robotlegs.base::MediatorMap/createMediator()[F:\_flex\HelloRobotLegs\src\org\robotlegs\base\MediatorMap.as:124]
            at org.robotlegs.base::MediatorMap/onViewAdded()[F:\_flex\HelloRobotLegs\src\org\robotlegs\base\MediatorMap.as:239]
            at flash.display::DisplayObjectContainer/addChild()
            at org.robotlegs.demos.helloflash::HelloFlashContext/startup()[F:\_flex\HelloRobotLegs\src\org\robotlegs\demos\helloflash\HelloFlashContext.as:60]
            at org.robotlegs.mvcs::Context/checkAutoStartup()[F:\_flex\HelloRobotLegs\src\org\robotlegs\mvcs\Context.as:213]
            at org.robotlegs.mvcs::Context()[F:\_flex\HelloRobotLegs\src\org\robotlegs\mvcs\Context.as:77]
            at org.robotlegs.demos.helloflash::HelloFlashContext()[F:\_flex\HelloRobotLegs\src\org\robotlegs\demos\helloflash\HelloFlashContext.as:41]
            at HelloFlash()[F:\_flex\HelloRobotLegs\src\HelloFlash.as:36]
  1. Support Staff 1 Posted by Till Schneidere... on 26 Nov, 2009 05:08 PM

    Till Schneidereit's Avatar

    Hey David,

    when using the Robotlegs source code, you have to add these parameters
    to your MXMLC configuration:
    -keep-as3-metadata+=Inject -keep-as3-metadata+=PostConstruct

    Alternatively, you could also use the Robotlegs SWC, which automates
    this process for you.

    hope you enjoy robotlegs,

  2. 2 Posted by David Cox on 26 Nov, 2009 05:15 PM

    David Cox's Avatar

    Thank you. I look forward to asking more relevant questions in the future.


  3. Support Staff 3 Posted by Till Schneidere... on 26 Nov, 2009 05:19 PM

    Till Schneidereit's Avatar

    Everyone's got to start somewhere - and welcome to Robotlegs, btw. :)

    And I just realized that we don't do a good job of explaining how to
    work with the Robotlegs source code on the homepage.

  4. 4 Posted by David Cox on 26 Nov, 2009 05:25 PM

    David Cox's Avatar

    Thanks. I'm looking forward to spending my weekend rebuilding an old PureMVC template with RobotLegs, tbh.

    I also just noticed the README file in the zip.

  5. 5 Posted by Helmut Granda on 02 Dec, 2009 05:58 PM

    Helmut Granda's Avatar


    I am running into the same issue, I downloaded the latest version of the sample files as well as the latest of robotlegs:


    and the eventDispatcher is the one breaking the app, as you can see below:

    All this is by using the default bundles with no customization except for adding the trace statement for the Event Dispatcher.

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at org.robotlegs.base::EventMap/mapListener()
    at org.robotlegs.demos.helloflash.view::ReadoutMediator/onRegister()
    at org.robotlegs.base::MediatorBase/preRegister()
    at org.robotlegs.base::MediatorMap/registerMediator()
    at org.robotlegs.base::MediatorMap/createMediator()
    at org.robotlegs.base::MediatorMap/onViewAdded()
    at flash.display::DisplayObjectContainer/addChild()
    at org.robotlegs.demos.helloflash::HelloFlashContext/startup()
    at org.robotlegs.mvcs::Context/checkAutoStartup()
    at org.robotlegs.mvcs::Context()
    at org.robotlegs.demos.helloflash::HelloFlashContext()
    at HelloFlash()

    Any ideas what could be causing this issue?

    I am compiling with Flash CS4 - Flash Player 10.

  6. 6 Posted by Helmut Granda on 02 Dec, 2009 06:07 PM

    Helmut Granda's Avatar

    Just by looking at the documentation I realized that the issue is with me using CS4 to compile the application:


    Just in case some one else runs into the same issue.

  7. 7 Posted by Jos Yule on 02 Dec, 2009 07:57 PM

    Jos Yule's Avatar

    You can use Robotlegs with CS4! But there is a trick to it. I'm in the process of writing a how-to, but here is the quick-n-dirty:

    in your context class, before you call super() in the constructor, do a

    injector = new SwiftSuspendersInjector(myConfigXML);

    Now, you will have to create the myConfigXML - take a look at the SwiftSuspendersInjector class to see how it looks.

    That should be enough to get you started...


  8. 8 Posted by Helmut Granda on 03 Dec, 2009 02:31 AM

    Helmut Granda's Avatar

    Thank you for the tip, I ended up writing a blog post with the steps I followed to make the update.


  9. Shaun Smith closed this discussion on 07 Dec, 2009 02:45 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