Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

Lightstreamer - Stock-List Demos - Flash Clients

This project contains two examples of Flash application that employs the Flash/Flex JavaScript Bridge.

Any Flash application can be fed with real-time data delivered by Lightstreamer Server. The integration strategy used is based on a JavaScript/ActionScript bridge. The standard Lightstreamer JavaScript Client Library is used to implement a page that will contain the Flash application and feed it through a LightstreamerClient object.
The library includes a bridge module. The lsjavascriptbridge.as library is added to the Flash movie.

The following diagram shows the data flow from Lightstreamer Server to the Flash application:

 ------          -------------------------------------------------
|  LS  |        |  LS core          JS           AS         Flash |
|      |  --->  | JavaScript -->  Bridge  -->          -->        |
|Server|        |  Client         module       Bridge        App  |
 ------          -------------------------------------------------
                                      BROWSER

Basic Stock-List Demo - Flash Client

Live Demo

Demo ScreenShot

View live demo

Details

This very simple demo uses the Flash Bridge to inject real-time data into two Flash movies hosted on the page. Each of the two movies subscribes to two items of the Stock-List Demos. The smaller movie sets a maximum update frequency of 1 event/sec.

The Flash app uses the ActionScript/JavaScript Bridge provided as part of the "sdk_client_flash". That means the ActionScript API, used within the Flash application, talks to external JavaScript code, in the form of the FlashBridge class, that, in turn, uses a LightstreamerClient instance to handle the communications with Lightstreamer Server.

The demo includes the following client-side functionalities:

  • A FlashTable containing 2 items, subscribed to in MERGE mode, for each Flash movie.

Stock-List Demo - Flash Client

Live Demo

Demo ScreenShot

View live demo

Details

This is a Flash version of the Lightstreamer - Basic Stock-List Demo - HTML Client, which displays eight stock quotes with some nice graphic effects.

The Flash app uses the ActionScript/JavaScript Bridge provided as part of the "sdk_client_flash". That means the ActionScript API, used within the Flash application, talks to external JavaScript code, in the form of the FlashBridge class, that, in turn, uses a LightstreamerClient instance to handle the communications with Lightstreamer Server.

The demo includes the following client-side functionalities:

  • A FlashTable containing 8 items, subscribed to in MERGE mode.

Install

If you want to install a version of these demos pointing to your local Lightstreamer Server, follow these steps:

  • Note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
  • Launch Lightstreamer Server.
  • Download the deploy.zip file that you can find in the deploy release of this project and extract the Flash_StockListDemo_Basic and/or Flash_StockListDemo folder.
  • Crate the folders /pages/demos/[demo_name] into your Lightstreamer server installation, then copy here the contents of the Flash_StockListDemo_Basic or Flash_StockListDemo folder.
  • Get the lightstreamer.js file from Lightstreamer distribution (see compatibility notes below) in the /DOCS-SDKs/sdk_client_web_unified/lib folder and put it in the /[demo_name]/js folder of the demo. The version required by this demo can be found in Lightstreamer version 5.1.2 to 7.0.
  • Get the require.js file form requirejs.org and put it in the /[demo_name]/js folder of the demo.
  • Get the swfobject.js version 2.2 file form SWFObject 2 and put it in the /[demo_name]/js folder of the demo.
  • Launch the demo.

Build

To build your own version of the Flash movies, instead of using the one provided in the deploy.zip file from the Install section above, the src/[demo_name]/flash directories contain the sources to build from a Flash IDE.
Before you can build the demos, you need to get the latest ActionScript/JavaScript Bridge (lsjavascriptbridge.as file) from the Lightstreamer Flash Client SDK resources.
Once the movies are obtained (test_movie.swf, test_movie2.swf, and demoFlashSmall.swf), copy them to the /js folders of their respective demo.

You can deploy these demos to use the Lightstreamer server as Web server or in any external Web Server you are running. If you choose the former case, please create the folders <LS_HOME>/pages/demos/[demo_name] then copy here the contents of the src/[demo_name] folder of this project.
The client demos configuration assumes that Lightstreamer Server, Lightstreamer Adapters, and this client are launched on the same machine. If you need to target a different Lightstreamer server, please search this line:

var lsClient = new LightstreamerClient(protocolToUse+"//localhost:8080","DEMO");

in lsClient.js or index.html, depending on the demo, and change it accordingly.
Anyway, the QUOTE_ADAPTER has to be deployed in your local Lightstreamer server instance; the LiteralBasedProvider is also needed, but it is already provided by Lightstreamer server.
The demos are now ready to be launched.

See Also

Lightstreamer Adapters Needed by These Demo Clients

Related Projectss

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer JavaScript Client library version 6.0 to 7.x.

About

This project includes different demos for Flash based on Lightstreamer StockList Adapter

Resources

License

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •