문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top