 
     public static function addCallback(functionName: String, closure: Function): void {
       ensureInitialized();
+      if (!closure) {
+        _addCallback(functionName, null, true);
+        return;
+      }
+
       _addCallback(functionName, function (request: String, args: Array) {
         var returnAsJS: Boolean = true;
         if (args == null) {

      }
      var catchExpr = marshallExceptions ? '\"<exception>\" + e + \"</exception>\";' : '\"<undefined/>\";';
      var evalExpr: String = 'try {' +
        '__flash_toXML(' + functionName + '(' + argsExpr + '));' +
        '} catch (e) {' + catchExpr + '}';
      var result: String = _evalJS(evalExpr);
      if (result == null) {

          }
        }
        return returnAsJS ? convertToJSString(result) : convertToXMLString(result);
      }, false);
    }
    private static function convertToXML(s: String): XML {
      var savedIgnoreWhitespace: Boolean = XML.ignoreWhitespace;
