Create controllers in the new way (actionscript wants to be all growed up

just like uncle Java!).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4028 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-04-18 01:58:44 +00:00
parent a0ff0d1457
commit cd8f168452
2 changed files with 7 additions and 12 deletions
@@ -313,18 +313,13 @@ public class LocationDirector extends BasicDirector
_placeId = placeId;
// check whether we should use a custom class loader
var cclass :Class = config.getControllerClass();
try {
// start up a new place controller to manage the new place
_controller = (new cclass() as PlaceController);
_controller.init(_cctx, config);
} catch (e :Error) {
Log.warning("Error creating or initializing place controller " +
"[cclass=" + cclass +
", config=" + config + "].");
Log.logStackTrace(e);
_controller = config.createController();
if (_controller == null) {
Log.warning("Place config returned null controller " +
"[config=" + config + "].");
return;
}
_controller.init(_cctx, config);
// subscribe to our new place object to complete the move
_cctx.getDObjectManager().subscribeToObject(_placeId, this);
@@ -48,7 +48,7 @@ public /*abstract*/ class PlaceConfig
* this place. The controller class must derive from {@link
* PlaceController}.
*/
public function getControllerClass () :Class
public function createController () :PlaceController
{
return null;
}