Home > News > Debugging Fullscreen applications in Flex Builder

Debugging Fullscreen applications in Flex Builder

October 1st, 2008

Fullscreen debugging in Flex Builder is one of those things that should work right out of the box – but doesn’t. This is because your html wrapper requires allowFullScreen=”true” be present in the object/embed tags for any SWF file that invokes fullscreen and, you guessed it, the default html wrapper generated by Flex Builder doesn’t include it. This means that whenever you debug an application and set your stage display state to fullscreen you’ll get the following security error.

SecurityError: Error #2152: Full screen mode is not allowed.

If you wanted you could make Flex Builder generate a fullscreen enabled html wrapper each time by editing the template wrappers directly in the SDK to allow fullscreen. Of course then you would need to edit it back in the case that you want to disable fullscreen from the wrapper level and, lets face it, editing files in an sdk directly is never good practice.

A better solution is to create a fullscreen enabled wrapper and create a custom debug profile in Flex Builder to launch it. You could use SWFObject and build a custom wrapper thats fully XHTML compliant, or you could do what I did and duplicate the default wrapper in place and add a few lines to enable fullscreen like this.

In order to create the custom debug profile go into your project properties, select “Run/Debug Settings” and click “New”.

debugconfig.jpg

Here I’ve created a new debug configuration named “Fullscreen”. Notice in the highlighted field I’ve changed the debug file to point to the fullscreen enabled wrapper that we’ve created. Make sure you save your configuration and the next time you click the debug icon you’ll see additional option for fullscreen debugging.

launchconfig.jpg

Thats it, now you’re able to debug an application in fullscreen.

ian News

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.