hello flex issues

Juan Mendez's Avatar

Juan Mendez

06 Dec, 2009 12:36 AM

i downloaded robotlegs and swfsuspenders code and when i debug in Flex 3 HelloFlex.mxml, i get the following error from the begining

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

at org.robotlegs.demos.helloflex.view::MessageListMediator/onRegister()[/Users/juan/Desktop/<study>/framework/robotleg/samples/helloflex/org/robotlegs/demos/helloflex/view/MessageListMediator.as:20]
at org.robotlegs.base::MediatorBase/preRegister()[/Users/juan/Desktop/<study>/framework/robotleg/samples/helloflex/org/robotlegs/base/MediatorBase.as:66]
at org.robotlegs.base::MediatorMap/registerMediator()[/Users/juan/Desktop/<study>/framework/robotleg/samples/helloflex/org/robotlegs/base/MediatorMap.as:163]
at org.robotlegs.base::MediatorMap/createMediator()[/Users/juan/Desktop/<study>/framework/robotleg/samples/helloflex/org/robotlegs/base/MediatorMap.as:148]
at org.robotlegs.base::MediatorMap/onViewAdded()[/Users/juan/Desktop/<study>/framework/robotleg/samples/helloflex/org/robotlegs/base/MediatorMap.as:263]
at flash.display::DisplayObjectContainer/addChildAt()
at mx.managers::SystemManager/preloader_preloaderDoneHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2980]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:434]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1451]
at mx.preloaders::DownloadProgressBar/initCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1503]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:291]
at mx.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:442]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
  1. Support Staff 1 Posted by Shaun Smith on 06 Dec, 2009 12:52 AM

    Shaun Smith's Avatar

    Hello,

    If you compile against the source for both Robotlegs and SwiftSuspenders you must include:

    -keep-as3-metadata+=Inject
    

    and

    -keep-as3-metadata+=PostConstruct
    

    in your compiler options.

    Alternatively, you can just compile your app against the Robotlegs SWC.

    If you want to compile against the Robotlegs source, and you don't want to include the compiler options, then you should include the SwiftSuspenders SWC in your build path.

    Background: Robotlegs and SwiftSuspenders both need those compiler options. Using either SWC file will include the options for you. Robotlegs includes SwiftSuspenders in it, so it's not advisable to include both SWC files at the same time. Either just use the Robotlegs SWC, or link to the Robotlegs source and include the SwiftSuspenders SWC.

    We definitely need to make this more clear - Sorry for the inconvenience!

  2. Support Staff 2 Posted by Joel Hooks on 06 Dec, 2009 12:53 AM

    Joel Hooks's Avatar

    This is a linking issue (ie, the framework isn't linked). You need to add the robotlegs swc to your project's libs folder. If you have dropped the robotlegs and swiftsuspenders code into the HelloFlex project then you need to add the following to your compiler options:

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

  3. Support Staff 3 Posted by Shaun Smith on 07 Dec, 2009 03:00 PM

    Shaun Smith's Avatar

    I'm going to mark this issue as Resolved, but if you feel it hasn't been properly addressed, please feel free to re-open it.

  4. Shaun Smith closed this discussion on 07 Dec, 2009 03:00 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