Instantiate the MessageAdapter in the constructor rather than as an initializer. The old way compiled fine, but couldn't find sceneUpdated() during runtime. Flash compiler bug?
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@1100 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -46,6 +46,14 @@ public /*abstract*/ class SceneController extends PlaceController
|
||||
{
|
||||
super.init(ctx, config);
|
||||
_wctx = WhirledContext(ctx);
|
||||
|
||||
_updateListener = new MessageAdapter(
|
||||
function (event :MessageEvent) :void {
|
||||
if (event.getName() == SceneCodes.SCENE_UPDATE) {
|
||||
sceneUpdated(event.getArgs()[0] as SceneUpdate);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -75,13 +83,7 @@ public /*abstract*/ class SceneController extends PlaceController
|
||||
}
|
||||
|
||||
/** Used to listen for scene updates. */
|
||||
protected var _updateListener :MessageListener = new MessageAdapter(
|
||||
function (event :MessageEvent) :void {
|
||||
if (event.getName() == SceneCodes.SCENE_UPDATE) {
|
||||
sceneUpdated(event.getArgs()[0] as SceneUpdate);
|
||||
}
|
||||
}
|
||||
);
|
||||
protected var _updateListener :MessageListener;
|
||||
|
||||
protected var _wctx :WhirledContext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user