<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,33 +1,58 @@
 = LzOsUtils
 
 This package contains a grab-bag of utilities that I've used for
-writing OpenLaszlo applications.  It extensions in these areas:
-* It makes OpenLaszlo JavaScript more like Browser JavaScript.
-* It enhances OpenLaszlo with equivalents to some of the JavaScript
-  libraries such as Prototype (whence the collection methods), and
-  jQuery (whence the +ajax+ methods).
-* It defines a powerful FlashBridge mechanism, for communication
-  between the browser JavaScript and the Flash application
-* Miscellaneous other utility features
+writing OpenLaszlo applications.  It defines extensions in these
+areas:
 
-== Browser Compatibility
 
-* +console+ object: compatible with Firebug; can proxy to browser console
-* browser compatibility: remove spurious warnings
+== Browser JavaScript Compatibility
 
-== JavaScript Library Equivalents
+The +console+ object is compatible with the Firebug +console+ API.  It
+can also proxy console methods to the browser console, for debugging
+applets that have been compiled without the inline OpenLaszlo
+debugger.
 
-More specifically:
-* collection methods, compatible with ECMAScript 1.7 and Prototype
-* +ajax+, +get+, and +post+ functions with jQuery-compatible arguments;
-  option for proxying to browser console for cross-domain cookies
+The browser compatibility file removes warnings on reference to an
+undefined property of an object.  I put this warning into OpenLaszlo
+in 2002; it was arguably a mistake then, and is definitely a mistake
+now.  Without it, you can write code more easily, and you can write
+libraris that run in both the browser and OpenLaszlo.
+
+Most of the other files in this package require the console and
+browser compatibility functions in order to run without warnings.
+
+
+== Ajax
+
+The +ajax+ file defines +ajax+, +get+, and +post+ functions with
+jQuery-compatible arguments.  When used with FlashBridge (below), it
+has an option for proxying AJAX calls to the browser, in order to use
+the browser's domain when the Flash application is served from a
+separate CDN.
+
+
+== FlashBridge
 
-== Flash to Browser communication
+FlashBridge is a mechanism for browser&lt;-&gt;flash communication.  This
+particular implementation has these properties:
 
-FlashBridge object for browser&lt;-&gt;flash communication with proxy objects
-and async return values
+* One component (the Flash application, or the browser JavaScript) can
+  *call any* function, or any method on any object, in the other
+  *component -- you don't have to register objects explicitly.
 
-== Other extensions
+* This facility also queues calls from the page into the flash applet
+  until the applet has loaded, solving some tricky race conditions.
+
+* You can define a proxy object in one component that delegates calls
+  through the bridge to an object in the other component.
+
+* The Flash application can call with a callback function to receive
+  return values as a continuation.
+
+
+== Other Extensions
+
+* collection methods, compatible with ECMAScript 1.7 and Prototype
 * xml syntax for filter effects
 * a grab bag of functional programming methods
 * a grab bag of view, string, and &quot;multithreading&quot; utilities</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,25 @@
 /* Copyright 2006-2008 by Oliver Steele.  All rights reserved. */
 
 function FlashBridge(id) {
-    this.movie = document.getElementById(id);
-    if (!this.movie)
-        window.console &amp;&amp; console.error &amp;&amp; console.error('no id=' + id);
+    var self = this;
     this.callWithoutCapturing = this.call;
+    this.synchronize();
+    var count = 10,
+        thread = setMovieObject() || setInterval(function() {
+            if (setMovieObject())
+                return clearInterval(thread);
+            if (--count &lt;= 0) {
+                window.console &amp;&amp; console.error &amp;&amp; console.error('no id=' + id);
+                clearInterval(thread);
+            }
+        }, 10);
+    function setMovieObject() {
+        var elt = document.getElementById(id);
+        if (elt &amp;&amp; elt.tagName.match(/object|embed/i)) {
+            self.movie = elt;
+            return true;
+        }
+    }
 }
 
 FlashBridge.initialize = function(id) {
@@ -142,7 +157,7 @@ FlashBridge.prototype.stopCapturingCalls = function() {
 FlashBridge.prototype.synchronize = function(timeout) {
     var startTime = new Date,
         self = this;
-    timeout = timeout || 10000;
+    timeout = timeout || 10*60*1000;
     this.startCapturingCalls();
     this.sendPing();
     var thread = setInterval(function() {</diff>
      <filename>lib/flashbridge-browser.js</filename>
    </modified>
    <modified>
      <diff>@@ -17,15 +17,11 @@
 	h: function() { logCall('h', arguments) },
 	j: function() { logCall('j', arguments) }
       };
-      setTimeout(function() {
-        // wait a frame, for swfobject to do its thing
-	FlashBridge.initialize('applet');
-	FlashBridge.synchronize();
-	var proxy = FlashBridge.createRemoteProxy('gReceiver', ['f', 'g']);
-	proxy.f(1, 2);
-	proxy.g(3);
-	proxy.f(4);
-      }, 10);
+      FlashBridge.initialize('applet');
+      var proxy = FlashBridge.createRemoteProxy('gReceiver', ['f', 'g']);
+      proxy.f(1, 2);
+      proxy.g(3);
+      proxy.f(4);
       function log() {
         var msg = Array.prototype.join.call(arguments, ' '),
 	    div = document.createElement('div');</diff>
      <filename>test/flashbridge/test-proxy.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>844c89b3159cf2fa10e8b1ee62cb057f7a01e85c</id>
    </parent>
  </parents>
  <author>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </author>
  <url>http://github.com/osteele/lzosutils/commit/9cba4739d89e3022e4ca2a798c7a8f637c2d2f13</url>
  <id>9cba4739d89e3022e4ca2a798c7a8f637c2d2f13</id>
  <committed-date>2008-04-12T18:09:01-07:00</committed-date>
  <authored-date>2008-04-12T18:09:01-07:00</authored-date>
  <message>flashbridge autosyncs; waits for swfobject to convert</message>
  <tree>0d5ae5faa0a8f863b64149466d24be3efdadcf24</tree>
  <committer>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </committer>
</commit>
