From a6de2c9bc69968f8be0181f47631a2dd4e430451 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 10 Jan 2007 19:51:49 +0000 Subject: [PATCH] Added isConnected(). git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@144 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/EZGameControl.as | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/ezgame/EZGameControl.as b/src/as/com/threerings/ezgame/EZGameControl.as index fd9ffa46..d9b6d23b 100644 --- a/src/as/com/threerings/ezgame/EZGameControl.as +++ b/src/as/com/threerings/ezgame/EZGameControl.as @@ -26,16 +26,23 @@ public class EZGameControl extends EventDispatcher event.userProps = new Object(); populateProperties(event.userProps); disp.root.loaderInfo.sharedEvents.dispatchEvent(event); - if (event.ezProps != null) { + if ("ezProps" in event) { 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); } + /** + * Are we connected and running inside the EZGame environment, or + * has someone just loaded up this swf by itself? + */ + public function isConnected () :Boolean + { + return (_gameData != null); + } + // documentation inherited override public function addEventListener ( type :String, listener :Function, useCapture :Boolean = false,