开发者

RobotLegs - Mediator for main application class

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.m开发者_C百科apView(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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜