   import flash.display.StageAlign;
   import flash.display.BitmapData;
   import flash.display.Loader;
+  import flash.events.ErrorEvent;
   import flash.events.Event;
   import flash.events.IOErrorEvent;
+  import flash.events.UncaughtErrorEvent;
   import flash.text.TextField;
   import flash.system.Security;
   import flash.geom.Point;


    }

    private function debug(str:String):void {
      ExternalInterface.call('console.log', str);
    }


    public function FlashCommon() {

      // Install event handler for uncaught errors.
      loaderInfo.uncaughtErrorEvents.addEventListener(
          UncaughtErrorEvent.UNCAUGHT_ERROR, handleError);

      // Declare external interface.
      ExternalInterface.marshallExceptions = true
      ExternalInterface.addCallback('isReady', isReady);
