OpenLaszlo and Full Screen / Kiosk Mode
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/

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”
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”;
}
}
Thanks for the code.
Which OL version do you use?
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
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 :
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/