Non-debug SWFs in Flash Builder

Posted on February 25, 2011 | 1 comment

So this is a little tip that has been coming up more and more often because of the need to export applications to the various package types (.bar, .apk, .ipa) and tooling not quite being there (or plugin support out of sync etc…).

The proper way to create a non-debug version of a specific package is to use the Flash Builder’s Export dialog. For example you will need to create a release version (non-debug) of your application to submit an PlayBook application (.bar) to BlackBerry’s AppWorld. With the Plugin install in Flash Builder Burrito you would right click on your project and select the Export…, then follow the dialog UI to create the .bar file.

For various reasons, you might be using other methods of packaging your applications or trying to package SWFs not supported in the tooling workflows at the current time, but still need a release version of the SWF. The easiest way to do this in Flash Builder regardless of AIR or web project, or if the Export is available or not is to add an argument to the compiler options. To do this go to: Project -> Properties -> Flex Compiler and then in the “Additional compiler arguments” add “-debug=false”. The figure below shows what I am talking about:

setting SWF to non-debug

And for another option (thanks to Josh Tynjala):
If you still want to be able to use the bin-debug SWF for debugging on the desktop, there’s another way too. Export a release build of the AIR package, but at the step where it asks you for your signing key, just cancel. You’ll be able to grab your unpackaged SWF out of the bin-release folder.