Home > Flex, Random Notes, tutorial > Compiling to Flash 10, requiring Flash 9

Compiling to Flash 10, requiring Flash 9

February 9th, 2009

Whenever Flash 10 came out a few months ago, they made a pretty big change to the security model which did not allow events to send files. Everything had to be handled by human interaction (AKA: MouseEvent.CLICK). Unfortunately that means that you now have to support both Flash 9 and Flash 10 in your flex/actionscript code. You never know when someone is going to upgrade to flash 10 to use your application. The problem is that in a business environment, it’s poor taste to require a business to upgrade everyone to Flash 10 to use your software. In fact, a lot of times, that upgrade is not even an option. If you compile something in Flash 10 though, your clients are greated with a nice message of ‘You must upgrade your Flash player in order to use this’. What we need to do is maintain binary compatibility with Flash 10, however not require it.

For Flex projects:
Right click on your main project folder and go to properties. From there, select Flex Compiler. Make sure the “Require Flash Player version” is set to 10.0.x (x being whatever version you have installed).
Next open up your .actionScriptProperties and search for “htmlPlayerVersion”. Make sure that is set to the same number as your required flash player number.
After that, open up your index.template.html file (inside of the html-template directory) and look for these lines:

    var requiredMajorVersion = ${version_major};
    // Minor version of Flash required
    var requiredMinorVersion = ${version_minor};
    // Minor version of Flash required
    var requiredRevision = ${version_revision};

you can manually change those values. Here you can set them to a Flash 9 level, making them look something like this:

    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Minor version of Flash required
    var requiredRevision = 24;

For Flex library projects, you just need to set the .actionScriptProperties to the same number of Flash that you have installed.

Many businesses are extremely protective of what they allow on their computers. It has been my experience that attempting to force upgrades onto a customer to allow your program to run is usually not an option. Now this does not mean that you will not have to double check within your code which version of Flash they are running. You will still have to support both versions. When you do this, you will be able to build and compile all of your projects with Flash 10, but you will not have to worry about forcing your clients to upgrade. Of course, once you want your clients to use Flash 10, you will have to change your index.html.template back to the original state.

Flex, Random Notes, tutorial , , ,

  1. February 11th, 2009 at 11:54 | #1

    I’ve noticed a few issues with IE 7 and 8 with regards to recognizing the flash 10 plugin. Flash works fine in Chrome and Firefox. IE get stuck in a loop trying to install flash, every time failing, and asking again if you want to install it.

    I’m running Vista, and so I can’t simply uninstall IE7 or 8 and reinstall because it’s now apart of the OS. I’ve upgraded to the latest IE8 release, with still no fix.

    This really isn’t a complaint, since I prefer Chrome and Firefox over IE, but more as an observation with the Flash 10 plug-in and Vista versions of IE7/8.

  2. May 17th, 2011 at 22:34 | #2

    I discovered your weblog web site on google and test a couple of of your early posts. Continue to keep up the very good operate. I just further up your RSS feed to my MSN Information Reader. Searching for ahead to reading extra from you afterward!รท

  1. No trackbacks yet.