Ludicrous Software

SetFullScreen (and Other Fscommands)

Hayden asked about the ability to go fullscreen when launching a swf from within the browser. I don’t know about Javascript-based methods to do this, but here’s what I’ve figured out about that in terms of Flash Lite. I thought I’d also tack on some interesting bits about a couple of fscommands, namely SetSoftKeys and ExtendBacklightDuration.

The swf cannot access fullscreen mode itself, so this sounds like the same situation as with SE FL 1.1 phones. If the browser is in fullscreen mode to begin with, then the swf will run in fullscreen mode. Any calls to SetFullScreen in the swf are ignored.

SetSoftKeys exhibits behaviour that I can only describe as wacky: there appears to be a delay of approximately five seconds before the command is actually executed. If you start a swf that has a SetSoftKey call in the first frame, it does not take effect right away, so for a brief period of time you can still access the regular browser functions with the soft keys (menu for the left button, back for the right). But then, once the SetSoftKey ‘takes effect’, it effectively locks up the browser. I tried one swf and, until I realized that the ‘end call’ button acts as a sort of kill command to the browser, had to keep restarting the phone to be able to get out of that swf. Perhaps this is the standard behaviour for SE phones, but if so, it seems an unfortunate decision. It would seem better to not allow the remapping of the keys at all than to create a situation where it seems impossible to exit a swf.

Lastly, ExtendBacklightDuration. This works as expected, although it appears that interacting with the accelerometer will reset the backlight duration to the default. If you’re creating a game/app where the only means of interaction is via the accelerometer - and so there is an extended period of time where the user is not pressing any buttons on the phone - the backlight will turn off. This, obviously, is not the optimal user experience.

Luckily, there’s a dead simple way around this. Just throw the following code into your movie, and you won’t have to worry about the problem:

function keepBacklightOn() {
     fscommand2("ExtendBacklightDuration", 5);
}
var lightInterval:Number = new Number();
lightInterval = setInterval(keepBacklightOn, 5000);

This just creates an interval that will set the backlight duration to 5 seconds; the interval is run every 5 seconds, so the effect is to keep the light on all the time. You just have to remember to turn this off if/when you don’t need it - if the user is interacting with a menu, or if the game is paused, for example - to avoid draining the battery unnecessarily.