another EventDispatcher is null
Hello,
first time I'm implementing robotLegs.
I followed the screencast from John Lindquist but I recieve the
follwing error
at org.robotlegs.base::EventMap/mapListener()
at com.example.view::CategoryViewMediator/onRegister()
...
When I trace the eventDispatcher in my mapListener, it outputs
null.
When I say export to SWC in my publish settings it all works
fine.
But now I'm stuck, what's going wrong? I've read through the commen
problems post, but no help.
I'm using the swc files for Robotlegs.
If you need more info, pls let me know.
this is my code for the viewMediator:
public class CategoryViewMediator extends Mediator {
[Inject]
public var categoryView:CategoryView;
override public function onRegister() : void
{
eventMap.mapListener(eventDispatcher, GreetingEvent.GREET, onGreet);
dispatch(new GreetingEvent(GreetingEvent.REQUEST_GREETING));
}
private function onGreet(event:GreetingEvent) : void
{
categoryView.updateGreeting(event.message);
}
}
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 1 Posted by Stray on 09 Jun, 2011 11:07 AM
Hi Vic,
I'm assuming you're using the Flash CS3/4/5 IDE?
You have to keep 'export to swc' ticked as otherwise Flash won't include the metadata for the [Inject] tags, and so all your eventDispatchers and other injected values will be missing.
Stray
2 Posted by Vic on 09 Jun, 2011 11:09 AM
yes, I'm using CS5.
Ah ok, so the export to SWC must be checked.
Thought that wasn't necessary.
Thanks.
3 Posted by Michal Wroblews... on 10 Jun, 2011 08:53 AM
It's necessary because only with export to SWC metadata tags like [Inject] are preserved. If not they're ignored by the compiler. That's all
4 Posted by Vic on 10 Jun, 2011 08:55 AM
Tnx guys! Already lovin' it :-)
Support Staff 5 Posted by Stray on 10 Jun, 2011 10:03 AM
Excellent!
I'll close this now - just open a new thread if you have any more questions.
Stray closed this discussion on 10 Jun, 2011 10:03 AM.