Example Code throws exceptions when compiling with MXMLC

sascha's Avatar

sascha

02 Jun, 2010 02:53 PM

Trying to get the example working (HelloFlash) with Robotlegs v1.1 and SwiftSuspenders v1.51 to get myself familiar with RL but the app throws exceptions:

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

at org.robotlegs.base::EventMap/mapListener()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\base\EventMap.as:118]
at org.robotlegs.demos.helloflash.view::ReadoutMediator/onRegister()[D:\Work\Eclipse\repo.as3.robotlegs.examples\src\org\robotlegs\demos\helloflash\view\ReadoutMediator.as:46]
at org.robotlegs.base::MediatorBase/preRegister()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\base\MediatorBase.as:66]
at org.robotlegs.base::MediatorMap/registerMediator()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\base\MediatorMap.as:163]
at org.robotlegs.base::MediatorMap/createMediator()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\base\MediatorMap.as:148]
at org.robotlegs.base::MediatorMap/onViewAdded()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\base\MediatorMap.as:263]
at flash.display::DisplayObjectContainer/addChild()
at org.robotlegs.demos.helloflash::HelloFlashContext/startup()[D:\Work\Eclipse\repo.as3.robotlegs.examples\src\org\robotlegs\demos\helloflash\HelloFlashContext.as:60]
at org.robotlegs.mvcs::Context/checkAutoStartup()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\mvcs\Context.as:257]
at org.robotlegs.mvcs::Context()[D:\Work\Eclipse\repo.as3.robotlegs\src\org\robotlegs\mvcs\Context.as:89]
at org.robotlegs.demos.helloflash::HelloFlashContext()[D:\Work\Eclipse\repo.as3.robotlegs.examples\src\org\robotlegs\demos\helloflash\HelloFlashContext.as:41]
at HelloFlash()[D:\Work\Eclipse\repo.as3.robotlegs.examples\src\HelloFlash.as:36]

Can somebody point out what wrong with it?

  1. Support Staff 1 Posted by Shaun Smith on 02 Jun, 2010 03:33 PM

    Shaun Smith's Avatar

    If you are linking against the source for both RL and SwiftSuspenders, and are using the MXMLC compiler (Flash/Flex Builder, FlashDevelop etc), you will need to add:

    -keep-as3-metadata+=Inject
    -keep-as3-metadata+=PostConstruct
    

    to your compiler options. Alternatively, simply use the SWC files (they include the options above automatically). This is because the MXMLC compiler strips out non-standard metadata by default.

    If you are using the Flash IDE to compile you will need to select “Export SWC” under File > Publish Settings. This is because the Flash IDE compiler ignores metadata by default.

  2. 2 Posted by sascha on 02 Jun, 2010 04:16 PM

    sascha's Avatar

    Ahaa! Thanks a lot Shaun! That fixed it!

  3. Shaun Smith closed this discussion on 20 Jun, 2010 04:10 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