why would a dispatch fail?

Peter Weinstein's Avatar

Peter Weinstein

06 May, 2010 05:33 PM


I've been reworking my proof-of-concept demo with Robotlegs, and am several days in with good success so far. However, I've hit my first brick wall. The call to dispatch in the code below returns false, and the command is not instantiated.

        var pev:PlayerEvent = new PlayerEvent(PlayerEvent.SEEK, this.player);
        var ret:Boolean = dispatch(pev);

What is especially strange is that almost identical syntax is working perfectly elsewhere in the same mediator.

The API has no explanation of why a call to dispatch() might fail. Your help is much appreciated!

Be Well Communication, LLC

  1. 1 Posted by Peter Weinstein on 06 May, 2010 05:41 PM

    Peter Weinstein's Avatar

    Oops -- please ignore this post! With my newbie eyes I stared right past the fact that the syntax in the context class is event-specific. I was missing:

    commandMap.mapEvent(PlayerEvent.SEEK, PlayerCommand, PlayerEvent, false);

    Somehow it magically works that posting a discussion corrects the vision.

    Sorry for any distraction and thanks anyway!


  2. Support Staff 2 Posted by Shaun Smith on 06 May, 2010 05:43 PM

    Shaun Smith's Avatar

    Hi Peter,

    Dispatch will return false if there is no listener for the event:


    So, it would seem that there is no Command (or other listener) bound to this event on the event bus.

  3. Support Staff 3 Posted by Shaun Smith on 06 May, 2010 05:44 PM

    Shaun Smith's Avatar

    Ah, cool, glad you're sorted.

  4. Stray closed this discussion on 16 Feb, 2011 09:05 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