IEventDispatcher null in Model
I know this is a pretty common problem (based on the threads I've read thus far), so I'm hoping there is a really simple answer. I've got a model that has the IEventDispatcher injected into it as such:
[Inject]
public var eventDispatcher:IEventDispatcher;
The problem is that when I try to access eventDispatcher, it is null. I have a config file that is mapping my model:
injector.map(GameModel).asSingleton();
...and the config is added to my context:
_context = new Context()
.install(MVCSBundle)
.install(RelaxedEventMapExtension)
.configure(ModelConfig, ViewConfig, CommandConfig, ServiceConfig, EventConfig, StartupConfig)
.configure(new ContextView(this));
StartupConfig also contains a reference to IEventDispatcher, and is successfully using it (i.e. it is being injected correctly). I'm sure there is something ridiculously simple I'm missing here..?
Showing page 2 out of 2. View the first page
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
Support Staff 30 Posted by Ondina D.F. on 11 Jul, 2013 12:13 PM
Yes, that’s already been discussed in the previous posts. [http://knowledge.robotlegs.org/discussions/robotlegs-2/3724-ieventd...]
Ok, then we don’t need the StageSyncExtension at all.
We could do just this:
Oh yes, we should!!!
Support Staff 31 Posted by Shaun Smith on 11 Jul, 2013 12:31 PM
The StageSyncExtension is indeed the culprit here. I've been considering making it wait a frame for ages, I'm just a little concerned with subtle side-effects
Ondina D.F. closed this discussion on 30 Aug, 2013 07:55 AM.