From 6d2ecb8f6704c48ab6fc29cd5e01c0dc1caaeda2 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 8 Jan 2007 23:37:11 +0000 Subject: [PATCH] Don't generate a TypeError if we're not in an EZGame environment. It may be well worth adding an isConnected() method that can be used to test whether the EZGame stuff is connected or whether we should just show demo graphics or something. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@141 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/EZGameControl.as | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/as/com/threerings/ezgame/EZGameControl.as b/src/as/com/threerings/ezgame/EZGameControl.as index d1bb1231..fd9ffa46 100644 --- a/src/as/com/threerings/ezgame/EZGameControl.as +++ b/src/as/com/threerings/ezgame/EZGameControl.as @@ -26,7 +26,11 @@ public class EZGameControl extends EventDispatcher event.userProps = new Object(); populateProperties(event.userProps); disp.root.loaderInfo.sharedEvents.dispatchEvent(event); - setEZProps(event.ezProps); + if (event.ezProps != null) { + setEZProps(event.ezProps); + } else { + trace("The game is not being run in the ezgame environment"); + } // set up our focusing click handler disp.root.addEventListener(MouseEvent.CLICK, handleRootClick); @@ -100,9 +104,7 @@ public class EZGameControl extends EventDispatcher /** * Register an object to receive whatever events it should receive, - * based on which event listeners it implements. Note that it is not - * necessary to register any objects which appear on the display list, - * as they'll be registered automatically. + * based on which event listeners it implements. */ public function registerListener (obj :Object) :void {