diff --git a/src/as/com/threerings/ezgame/client/EZGamePanel.as b/src/as/com/threerings/ezgame/client/EZGamePanel.as index 2d9996fa..1a0f2641 100644 --- a/src/as/com/threerings/ezgame/client/EZGamePanel.as +++ b/src/as/com/threerings/ezgame/client/EZGamePanel.as @@ -51,7 +51,8 @@ public class EZGamePanel extends VBox _gameView = new GameContainer(cfg.configData); // TODO? backend.setSharedEvents( - Loader(_gameView.getMedia()).contentLoaderInfo.sharedEvents); + Loader(_gameView.getMediaContainer().getMedia()). + contentLoaderInfo.sharedEvents); backend.setContainer(_gameView); addChild(_gameView); } @@ -59,7 +60,7 @@ public class EZGamePanel extends VBox // from PlaceView public function didLeavePlace (plobj :PlaceObject) :void { - _gameView.shutdown(true); + _gameView.getMediaContainer().shutdown(true); removeChild(_gameView); backend.shutdown(); diff --git a/src/as/com/threerings/ezgame/client/GameContainer.as b/src/as/com/threerings/ezgame/client/GameContainer.as index a260e815..c760a96b 100644 --- a/src/as/com/threerings/ezgame/client/GameContainer.as +++ b/src/as/com/threerings/ezgame/client/GameContainer.as @@ -8,6 +8,8 @@ import mx.core.mx_internal; import mx.core.IFlexDisplayObject; import mx.core.IInvalidating; +import mx.containers.VBox; + import mx.managers.IFocusManagerComponent; import mx.skins.ProgrammaticSkin; @@ -21,17 +23,33 @@ import com.threerings.util.MediaContainer; // 3) When the mouse leaves the flash player and returns, this // damn thing doesn't seem to grip onto the focus. // -public class GameContainer extends MediaContainer +public class GameContainer extends VBox implements IFocusManagerComponent { public function GameContainer (url :String) { - super(url); + rawChildren.addChild(_game = new MediaContainer(url)); tabEnabled = true; // turned off by Container // focusRect = true; // we need the focus rect } + public function getMediaContainer () :MediaContainer + { + return _game; + } + +// override public function setFocus () :void +// { +// if (stage) { +// try { +// stage.focus = this; +// } catch (e :Error) { +// trace("Apparently, this might happen: " + e) +// } +// } +// } + override protected function adjustFocusRect (obj :DisplayObject = null) :void { super.adjustFocusRect(obj); @@ -52,5 +70,7 @@ public class GameContainer extends MediaContainer } } } + + protected var _game :MediaContainer; } }