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:
Par Winzell
2011-07-14 18:37:29 +00:00
parent ea5fee9091
commit 3f2fad7750
@@ -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;
}