Benjamin Shine wrote:

Max, can you please summarize in a few sentences the changes to the wrapper/embed pages in Beta1? Not the exact details of how to use them, but an overview of what was changed and why.

The HTML wrapper pages have been cleaned up and simplified for 4.0. Browser/javascript bridge and Flash embedding code has been completely rebuilt with dojo.flash.

SWF and DHTML runtimes now share a single javascript include (lps/includes/embed-compressed.js) containing all necessary code for embedding a swf or DHTML application.

Once this file is included in the page, the following APIs are available (from lps/includes/source/embednew.js):

Lz.swfEmbed(properties, minimumVersion) {
    /**
* Writes the necessary HTML to embed a swf file in the document where the
     * function is called.
     *
     * @param properties:Object properties used to write the swf, e.g.
* {url: 'myapp.lzx?lzt=swf', bgcolor: '#000000', width: '800', height: '600'}
     *
     * @param minimumVersion:Number the version the flash player should
     * upgrade to if necessary.  Defaults to 7.
     */

Lz.dhtmlEmbedLFC(url, allowUnsupported) {
    /**
     * Write <script/> tags into the document at the location where this
* function is called to load the LFC. Must be called before dhtmlEmbed().
     *
     * @param url:String url to LFC
     *
     * @param allowUnsupported:(true|false|undefined) if true, there
     * will be no check for unsupported browsers -- the LFC and app
     * will be loaded and executed.  If false, unsupported browsers
     * will not be permitted and a notice that the browser is not
     * supported will be displayed.  If undefined or omitted, the user
     * will queried if they want to 'try anyway' if the browser is
     * unsupported -- clicking `OK` (or `Cancel) will have the same
     * effect as a `true` (or `false`) value for this parameter
     */

Lz.dhtmlEmbed(properties) {
    /**
     * Write <script/> tags into the document at the location
     * where this function is called to load the LZX Application.
     *
     * @param properties:Object properties used to write the dhtml, e.g.
* {url: 'myapp.lzx?lzt=swf', bgcolor: '#000000', width: '800', height: '600'}
     *
     * Note: dhtmlEmbedLFC must have already been called, to load the
     * LFC and to do any browser-checking.  If dhtmlEmbedLFC has not
     * been called or the browser-check did not pass, this call will
     * not load the application.
     */

Lz.setCanvasAttribute(name, value) {
    /**
     * Sets an attribute on the canvas of an embedded SWF application
     *
     * @param name:String name of the property to set
     *
     * @param name:String value to set the property to
     */

Lz.getCanvasAttribute(name) {
    /**
* Reads an attribute from the canvas of an embedded SWF application and
     * returns its value
     *
     * @param name:String name of the property to read
     */

Lz.callMethod(js)
    /**
     * Calls javascript method in an embedded SWF application
     * returns its value
     *
* @param name:String javascript to call in the form 'foo.bar.methodcall(arg1,arg2,...)'
     */

In most cases developers never need to familiarize themselves with these APIs because the LPS server's wrapper system automatically generates the appropriate HTML.

--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to