Skip to content

Customizing the embed page and size

Mark Knol edited this page Jun 3, 2014 · 6 revisions

Flambe uses a default page to embed the game, if one isn't provided. You can provide one by copying that file to web/index.html in your project directory and customizing it.

The size of the game stage is controlled with CSS. To always make the game a certain size, change the #content CSS sizing in the default embed page (and remove the media query that goes fullscreen on small screens).

More about dealing with different screensizes, read Responsive game

Prioritize Flash or HTML

The order of the array matters.

// prioritizes flash over html
flambe.embed(["targets/main-flash.swf", "targets/main-html.js"], "content");

// prioritizes html over flash
flambe.embed(["targets/main-html.js", "targets/main-flash.swf"], "content");

Detect if Flambe is embedded

If you want to display a message when you have an old FlashPlayer version or non-supported device.

var isEmbedded = flambe.embed(["targets/main-flash.swf", "targets/main-html.js"], "content");
if (!isEmbedded) alert("Sorry, but your browser or flashplayer is too old!");
Clone this wiki locally