public
Description: OpenLaszlo utilities: flash bridge, ajax, etc.
Homepage:
Clone URL: git://github.com/osteele/lzosutils.git
lzosutils / test / flashbridge / test-proxy.lzx
100644 20 lines (19 sloc) 0.699 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<canvas debug="true">
  <library href="../../lib/flashbridge.lzx"/>
  <debug x="0" y="0" width="100%" height="100%"/>
  <script>
    // Set up an object for the browser to call
    var gAppletObject = {
      f: function() { console.info('gAppletObject.f', arguments.join(',')) },
      g: function() { console.info('gAppletObject.g', arguments.join(',')) }
    };
    // Create a proxy to an object in the browser html...
    var gBrowserObject = FlashBridge.createRemoteProxy(
      'gBrowserObject', // its name within the applet
      ['h', 'j']); // its methods
      // ...and call it:
    gBrowserObject.h(5, 6);
    gBrowserObject.j(7);
    gBrowserObject.h(8);
  </script>
</canvas>