Tip: Backwards Compatibility and Mac OS X

Targeting a game to a specific flash player version can be useful for many reasons. Since Player 11 was released there where many features added, but there are a few issues to consider.

For a game that runs on a [desktop] browser, player update may be required. This should not be a problem, except for some older versions of Mac OS X that can only run Flash 10.x, but not Flash 11. This is the case for OS X 10.4 (Tiger), and 10.5 (Leopard) – so if you want to target these your only option is to have your game compiled to Flash player 10 specs.

The best bet for this case is to target player version 10.3. First of all make sure you are not using any of the Flash 11 specific features (Stage3D and native JSON). Next you need to set the compiler option so the output SWF file would run properly on the older player, since the Flex 4.6 SDK defaults to Flash 11.

To do that, you need to invoke the swf-version compiler option. On any of the decent IDEs there is access to compiler command line options. Flash Builder, FDT and Flash Develop have it inside project settings, and if you are using ant script to build the code, the command line options are available in the mxmlc tag.

Simply add the following to the additional compiler arguments:

-swf-version=12

The swf-version compiler option specifies the SWF file format version of the output SWF file. Features requiring a later version of the SWF file format are not compiled into the application. This is different from the Player version in that it refers to the SWF specification versioning scheme. In this case 12 is the scheme for player 10.3.

As an added bonus, you’ll be able to debug the game code as if it is running in the target version. Any code that requires Flash 11 will cause a run time error with stack trace – that comes in handy in case there you left ‘invalid’ features hiding in the code.