tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/103-example-code-throws-exceptionsRobotlegs: Discussion 2018-10-18T16:35:12Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/18346372010-06-02T14:53:33Z2010-08-20T16:31:22ZExample Code throws exceptions when compiling with MXMLC<div><p>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:</p>
<p>TypeError: Error <a href="/discussions/problems/1009" title="Discussion #1009">#1009</a>: Cannot access a property or method of a null object reference.<br />
</p>
<pre><code>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]</code></pre>
<p>Can somebody point out what wrong with it?</p></div>saschatag:robotlegs.tenderapp.com,2009-10-18:Comment/18346372010-06-02T15:33:34Z2010-06-02T15:33:34ZExample Code throws exceptions when compiling with MXMLC<div><p>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:</p>
<pre>
<code>-keep-as3-metadata+=Inject
-keep-as3-metadata+=PostConstruct</code>
</pre>
<p>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.</p>
<p>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.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/18346372010-06-02T16:16:56Z2010-06-02T16:16:59ZExample Code throws exceptions when compiling with MXMLC<div><p>Ahaa! Thanks a lot Shaun! That fixed it!</p></div>sascha