OpenLaszlo and Full Screen / Kiosk Mode

Written on November 12th 2008, 17:11 by sYnie

I read about OpenLaszlo and full screen mode at the Laszlo forums. So I thought to publish a very small demo of how to create a solo app, that uses this feature. Here is a demo:

It’s pretty easy, as you can access the AS objects directly with OpenLaszlo:

<canvas>
<script>
Stage.scaleMode = "noScale";
Stage.align = "TL";
function toggleFullScreen() {
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
} else {
Stage["displayState"] = "normal";
}
}
</script>
<button text="Toggle Fullscreen" onclick="toggleFullScreen()" x="${parent.width/2-this.width/2}" y="${parent.height/2-this.height/2}"/>
</canvas>

Deploy it as a solo app and integrate it into your website like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0" width="200" height="200">
<param name="allowFullScreen" value="true" />
<param name="movie" value="fullscreen.swf" />
<embed src="fullscreen.swf" allowFullScreen="true" width="200" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

There it is. Your very own full screen app ;-)
There are some restrictions (like for keyboard input) and I haven’t tried to use it in a server deployment, yet. So feel free to experiment …

This method is outdated. With 4.4 there’s a built-in method. Have a look at:
http://openfuture.rajubitter.com/2009/07/01/openlaszlo-44-released-video-components-improved-full-screen-support-for-swfx/

  1. Ivan Tcholakov
    December 31st, 2008 at 20:12 | #1

    How to deal with this?

    Compilation Errors

    org.openlaszlo.sc.CompilerError: fullscreen.lzx: 3: Error: Access of possibly undefined property scaleMode through a reference with static type Class, in line: Stage.scaleMode = “noScale”;
    fullscreen.lzx: 4: Error: Access of possibly undefined property align through a reference with static type Class, in line: Stage.align = “TL”

  2. Ivan Tcholakov
    January 2nd, 2009 at 03:46 | #2

    I am leaving here a modified version of the script that worked for me:

    LFCApplication.stage.scaleMode = “noScale”;
    LFCApplication.stage.align = “TL”;

    function toggleFullScreen() {
    if (LFCApplication.stage.displayState == “normal”) {
    LFCApplication.stage.displayState = “fullScreen”;
    } else {
    LFCApplication.stage.displayState = “normal”;
    }
    }

  3. January 2nd, 2009 at 13:12 | #3

    Thanks for the code.
    Which OL version do you use?

  4. Alexwebmaster
    March 3rd, 2009 at 10:26 | #4

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  5. Renaud
    March 18th, 2009 at 17:46 | #5

    Here is my snippet for toggleFullScreen() working with swf8 and swf9 :

    function toggleFullScreen()
    {
    var objStage = $swf8 ? Stage : canvas.sprite.stage;
    objStage.displayState = (objStage.displayState == "fullScreen" ? "normal" : "fullScreen");
    }

    … And in my html object tag :

  6. July 6th, 2009 at 02:05 | #6

    Support for full screen/kiosk mode is built into the OpenLaszlo platform now, starting with version 4.4 – that has been just released. A documentation of how it works can be found in my blog at http://openfuture.rajubitter.com/2009/07/01/openlaszlo-44-released-video-components-improved-full-screen-support-for-swfx/

  1. January 10th, 2009 at 03:56 | #1