0
votes

I'm trying to mediate the main application class ( the 'Document class' of a Flash *.fla project)

I have this on the Application Context startup():

... mediatorMap.mapView(MyApplication,MyApplicationMediator); mediatorMap.createMediator(contextView);

The MyApplicationMediator:

public class MyApplicationMediator extends Mediator {
[Inject]
public var view:MyApplication;
override public function onRegister():void {
trace("I am registered!");
}

So onRegister() gets called, but view is null. Also when I try to add the eventListeners I get a null reference error.

1
Nevermind. I just forgot to check the option 'Export SWC' in publish settings. That is needed in order to the annotations (metadata) work.Johnny Everson

1 Answers

1
votes

This is generally a result of compiling robotlegs from source and not having keep-as3-metadata +=Inject as a compiler option.

I think that your createMediator call is superfluous. The contextView is a "special" case in that it is already added to the stage so by default when the mediator is set via mapView it gets created automatically.

This Common Problems section of the wiki is a pretty decent resource.