I ran into some issues today trying to get my first Robotlegs based application to run. I was using Flash Professional as my publishing tool and Flash Builder 4 as my code editor, and for some reason whenever I tried to publish the compiler would bark about a null object reference whenever I tried to access one of my views. After a bit of digging I stumbled across a blog post stating that you have to check the “Export swc” option in the Flash Professional publish settings when building a Robotolegs project using flash. After updating my publish settings everything worked perfectly. This has something to do with the compiler stripping out the [Inject] metadata when publishing the .swf.
If you are trying to compile a Robotlegs project using Flashbuilder, then you may run into a similar situation, in which case the solution is to include custom compiler arguments to tell the compiler to include the [Inject] metadata during compilation.
There’s a lot of helpful information on the Robotlegs wiki, this specific issue is talked about in detail here: https://github.com/robotlegs/robotlegs-framework/wiki/Common-Problems
More Robotlegs Gotcha’s: