Troubles & thoughts

creynders's Avatar


22 Oct, 2009 02:05 PM

I'm very excited about RobotLegs, it adresses all my complaints about PureMVC.
However, I have a problem separating the initialization of the various parts:

If I map my commands in the startup method of my context file, everything initializes fine, however if i try to separate this into commands (for instance PrepViewCommand) which is triggered by dispatching the STARTUP event in the context's startup method, the player complains with "TypeError: Error #1009: Cannot access a property or method of a null object reference."
When I inspect the PrepViewCommand it has 'null' for all it's properties.

I got this approach from the GoogleMaps example. Could it be that it's not possible to use that approach anymore?

  1. Support Staff 1 Posted by Till Schneidere... on 22 Oct, 2009 02:10 PM

    Till Schneidereit's Avatar

    Hey creynders,

    sounds like something goes wrong with the injections. Could you maybe
    post the contents of your PrepViewCommand for us to inspect?


  2. Support Staff 2 Posted by creynders on 22 Oct, 2009 02:48 PM

    creynders's Avatar

    Sure, in att.
    It's very short though, I can attach all the code if you want.

  3. Support Staff 3 Posted by creynders on 22 Oct, 2009 02:57 PM

    creynders's Avatar

    Ok, I figured it out.
    I'm not used to using custom metadata, so I didn't know that you need to add the metadata name to your compiler options.
    I figured it out when I saw the custom [Inject] tags, and googled for 'flex compiler custom metadata', however this is probably something you need to put some emphasis on in the documentation for noobs like me :)

  4. Support Staff 4 Posted by Joel Hooks on 22 Oct, 2009 03:01 PM

    Joel Hooks's Avatar

    The SwiftSuspenders library requires this if compiling from source,
    but the SWC version of Robotlegs shouldn't require the compiler
    option. I'd like to investigate which version of Robotlegs are you
    using (where did you download it)?

  5. Support Staff 5 Posted by creynders on 22 Oct, 2009 03:15 PM

    creynders's Avatar

    I'm using the swiftsuspender source files for my own code and was using the latest robotlegs .swc for the FlexHelloWorld example, that's why the example compiled w/o problems, yet my own code didn't.

    So, nothing wrong there, just my own ignorance... :)

    BTW I just wanted to say (here comes the 'thoughts' bit from the subject line) that I really think this is going to become my framework of choice. It looks so clean and when coming from PureMVC so much less cumbersome. I think Cliff's doing a great job to make it cross-platform/technology, but for a flash/flex coder like myself this is faaaaaaaaaaaar more satisfying and time-saving than pmvc.
    Keep up the magnificent work!

  6. Support Staff 6 Posted by Till Schneidere... on 22 Oct, 2009 03:35 PM

    Till Schneidereit's Avatar

    Hey creynders,

    glad that you figured it out. I wish mxmlc would at least spit out
    warnings for metadata it doesn't keep.

    And I absolutely share your feelings about RobotLegs - it's really
    awesome how much it improved my workflow.


  7. Support Staff 7 Posted by Joel Hooks on 22 Oct, 2009 03:37 PM

    Joel Hooks's Avatar

    Ah, That explains it. If you use the SwiftSuspenders and Robotlegs
    source projects (this is how I have it set up) you won't have any
    problems, but dropping the source into your code will require the
    extra compiler option. SwiftSuspenders Flash Builder project already
    has this compiler flag set.

    I will add this to the FAQ.


    Joel Hooks (@jhooks)

  8. Joel Hooks closed this discussion on 29 Oct, 2009 11:35 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