Flash/Flex Client (JS Bridge)
This document is the API Specification for
Flash/Flex Client (JS Bridge).
Summary
This SDK contains two libraries: one for JavaScript (lsflashbridge.js)
and one for ActionScript (lsjavascriptbridge.as). Such two libraries directly
communicate in order to inject any real-time events received from Lightstreamer
Server (through the Lightstreamer Web Client) into a Flash or Flex
application.
In order to achieve this:
- Include
flash.external.ExternalInterface and lsjavascriptbridge.as in each Flash movie
where pushed data have to be displayed. Note that the .as file uses
ExternalInterface.addCallback to expose through JavaScript some methods. This means
you should not expose methods with the same names:
- onReady
- onStatusChange
- onLostUpdates
- onEndOfSnapshot
- onItemUpdate
- onStart
- Create and configure a
JavaScriptBridge object and add a "Table" object for each data table to be
requested. You must give to the JavaScriptBridge object a name. This name will
be also used in the HTML page and in the JavaScript code.
- Include
lsflashbridge.js (lscommons.js and lspushpage.js see below) in each page where a
Flash movie that needs pushed data has to be embedded. Then create and configure
a FlashBridge object with the same name previously given to the JavaScriptBridge
object.
- Make each page where a Flash movie is being embedded a "Push-
page" using the Web Client SDK.
- Embed your Flash movie in the Push-
page. Use the name given to JavaScriptBridge and FlashBridge as the "id" of the
object tag and as the "name" of the embed tag.
Lightstreamer Flash/Flex Client (JS Bridge), Copyright © 2004-2007 Weswit Srl. All Rights Reserved.
Documentation generated by
JSDoc on Mon Sep 3 10:25:36 2007