Targeting Flash Player 10 (UPDATED for FB 3.0.2)This document should help you write applications against Flex SDK nightly builds which target the Flash Player 10. It is relevant primarily for Flex 3 as the Flex Gumbo SDK only targets Flash Player 10. Text in red has been updated for FB 3.0.2. First Things FirstGrab a nightly build from Download Flex 3, dated Wednesday Oct 29, 2008 (3.2 Milestone build), or later. FLEX_SDK is used hereafter to refer to the directory where you unzipped the sdk. Before going further, make sure that you have a Flash 10 playerglobal.swc at FLEX_SDK/frameworks/libs/player/10/playerglobal.swc. Command-line CompilerTo make all compiles target player 10:
Alternately, if you want to target either Player 9 or Player 10 with the same SDK:
Setting --target-player=10.0.0 causes {targetPlayerMajorVersion} to expand to 10, the major version. This will change which playerglobal.swc is selected depending on -target-player (which defaults to 9.0.115 on the command-line, 9.0.28 in Flex Builder). Note: If you use Flex Builder with these changes, you will lose code-hints for classes in playerglobal.swc (such as DisplayObject), because {targetPlayerMajorVersion} confuses FB3's code model. FB4 will handle {targetPlayerMajorVersion} correctly. You could also leave flex-config.xml alone and override just the changed values in your own configuration file, that you load with the -load-config option. You will want to hardcode the changes for 10; (don't use {targetPlayerMajorVersion}, in order to avoid FB's code-hinting problem). It's left as an exercise for the reader Flex Builder Application ProjectsCreate a new application project. Edit the project properties:
If you do not want have to manually configure playerglobal.swc, follow the directions above for "Command-line Compiler" to: use your own flex-config, use {targetPlayerMajorVersion} (but you will not get code hinting for classes in playerglobal.swc), or change the SDK to always target Flash Player 10. In FB 3.0.2, you should be able to use {targetPlayerMajorVersion} and still get code-hinting – file a bug if you find this is not the case. Flex Builder Library ProjectsLibrary projects don't have "Require Flash Player version", so there's no direct way to change the target player from project properties. Take an existing library project, open project properties:
|
|
Hi Jerome,
Unfortunately if your SWF is compiled to target Player 10 it is likely not going to run at all in FP9. So you can't have 9 detected in your JS, it has to be 10. Flash Player does not run newer SWFs, it runs SWF targeted at its own version and lower.
>Flash Player does not run newer SWFs
Actually, I'd rather say that it doesn't allow for API calls it doesn't understand... But I'd tend to say that if these calls (like FileRefernce.save()) are protected by imposing proper conditions (eg using Capabilities.version), then there shouldn't be any problem, right?
Anyway, I've managed to solve my problem by checking "Require Flash Player version 10.0.0", and hardcoding "var requiredMajorVersion = 9;" in the HTML wrapper, so that is works fine in both FP9 and 10, using FileReference.save if Capabilities.version is >= 10, and resorting to the old "save on server then download" technique for FP9 users...
Now the fact that this works probably means that the "Require Flash Player (...)" option in the HTML wrapper section of the Project properties panel does more than than simply affecting the HTML wrapper, no?
Thanks,

Hi Matt, thanks for your fast reply.
I don't have any problem in "targetting" FP10, I just want to avoid imposing its detection upfront. So my idea was to compile using SDK 3.2, target FP 10.0.0 (in flex-config.xml), but only ask for FP >= 9.0.0 in the JS version detection script.
But this doesn't seem to work: I've tried many options/combinations, the only one that makes FileReference.save work is when I ask for FP10 in the detection script, which again, seems very strange to me. Shouldn't that work??
Thanks again for the support,