why would a dispatch fail?
Hi,
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!
Thanks,
Peter
Be Well Communication, LLC
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
1 Posted by Peter Weinstein on 06 May, 2010 05:41 PM
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!
Peter
Support Staff 2 Posted by Shaun Smith on 06 May, 2010 05:43 PM
Hi Peter,
Dispatch will return false if there is no listener for the event:
http://github.com/robotlegs/robotlegs-framework/blob/v1.0.3/src/org...
So, it would seem that there is no Command (or other listener) bound to this event on the event bus.
Support Staff 3 Posted by Shaun Smith on 06 May, 2010 05:44 PM
Ah, cool, glad you're sorted.
Stray closed this discussion on 16 Feb, 2011 09:05 PM.