From 3f2fad77506b4fc5ac350c1972a4347248717cce Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Thu, 14 Jul 2011 18:37:29 +0000 Subject: [PATCH] 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 --- .../threerings/whirled/client/SceneController.as | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/as/com/threerings/whirled/client/SceneController.as b/src/main/as/com/threerings/whirled/client/SceneController.as index 3df9d9cb..2a9eaf50 100644 --- a/src/main/as/com/threerings/whirled/client/SceneController.as +++ b/src/main/as/com/threerings/whirled/client/SceneController.as @@ -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; }