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
This commit is contained in:
Ray Greenwell
2007-01-08 23:37:11 +00:00
parent 08d317b329
commit 6d2ecb8f67
@@ -26,7 +26,11 @@ public class EZGameControl extends EventDispatcher
event.userProps = new Object(); event.userProps = new Object();
populateProperties(event.userProps); populateProperties(event.userProps);
disp.root.loaderInfo.sharedEvents.dispatchEvent(event); 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 // set up our focusing click handler
disp.root.addEventListener(MouseEvent.CLICK, handleRootClick); 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, * Register an object to receive whatever events it should receive,
* based on which event listeners it implements. Note that it is not * based on which event listeners it implements.
* necessary to register any objects which appear on the display list,
* as they'll be registered automatically.
*/ */
public function registerListener (obj :Object) :void public function registerListener (obj :Object) :void
{ {