Targeting Flash Player 10 Beta (UPDATED for FB 3.0.2)
This document should help you write applications against Flex SDK nightly builds which target the Flash Player 10 Beta.
Text in red has been updated for FB 3.0.2 when it becomes available.
First Things First
Grab a nightly build from Download Flex 3 or Download Flex 4, dated Thursday May 15, 2008, 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 Compiler
Many of these instructions may be unnecessary for Gumbo builds which target Player 10 by default (and may not include Player 9).
To make all compiles target player 10:
- Modify FLEX_SDK/frameworks/flex-config.xml. Edit <target-player>, replacing 9.0.115 with 10.0.0:
- In <external-library-path>, edit the path-element for playerglobal.swc, replacing 9 with 10:
- Do the same with <library-path:
Alternately, if you want to target either Player 9 or Player 10 with the same SDK:
- Add -target-player=10.0.0 to your mxmlc or compc calls
- In <external-library-path>, edit the path-element for playerglobal.swc, replacing 9 with {targetPlayerMajorVersion}:
- Do the same with <library-path>:
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). This will circumvent FB's code hinting problem. It's left as an exercise for the reader 
Flex Builder Application Projects
These instructions may not be suitable for Gumbo but should provide some guidance.
Create a new application project. Edit the project properties:
- Open the "Flex Build Path" tab.
- Expand "Flex 3", select "playerglobal.swc" and click "Remove".
- Note the directory path in "Flex 3 - " (on my system it's /Applications/Adobe Flex Builder 3 Plug-in/sdks/3.0.0).
- Click "Add SWC" and navigate to the that path, and then deeper into frameworks/libs/player/10, select playerglobal.swc.
- Expand "playerglobal.swc", double-click "Link Type" and change it to "External".
- Open the "Flex Compiler" tab
- In "HTML wrapper", change the "Require Flash Player version" to 10.0.0. Alternately, you can override this value for the compiler by adding -target-player=10.0.0 to "Additional commandline arguments", and leaving HTML wrapper alone (note: there's a bug in FB 3.0.2, it will only detect this correctly with an equal-sign, so don't write -target-player 10.0.0.)
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 Projects
Library 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:
- Go to the "Info" tab, note the "Location" of your project. Close Flex Builder.
- Edit PROJECT_LOCATION/.actionScriptProperties and search for 9.0.28, change it to 10.0.0, save it. In FB 3.0.2 you can override this value for the compiler by adding -target-player=10.0.0 to "Additional commandline arguments", and leaving the property file alone (note: there's a bug in FB 3.0.2, it will only detect this correctly with an equal-sign, so don't write -target-player 10.0.0.)
- Reopen Flex Builder, right click on the project and select "Refresh".
- Re-open project properties, and open the "Flex Library Build Path" tab.
- Expand "Flex 3", select "playerglobal.swc" and click "Remove". In FB 3.0.2, you should be able to leave playerglobal.swc alone and use {targetPlayerMajorVersion} and still get code-hinting – file a bug if you find this is not the case.
- Note the directory path in "Flex 3 - " (on my system it's /Applications/Adobe Flex Builder 3 Plug-in/sdks/3.0.0).
- Click "Add SWC" and navigate to the that path, and then deeper into frameworks/libs/player/10, select playerglobal.swc.
- Expand "playerglobal.swc", double-click "Link Type" and change it to "External".
- Finally, go to the "Project" menu, select "Clean..." and "Clean All Projects".
| You must be logged in to comment. |
|
 |
I managed to get Flex Builder setup easily enough to compile SWF files for FP10, and everything is running as expected except for the fact that Flex Builder (the AS editor) doesn't recognise any of the new object properties such as .z .rotationX .rotationY .rotationZ etc, I am having to use hacky fooSprite["rotationX"]=123 markup. Is there anyway to get Flex Builder to recognise the new FP10 specific object properties?
FYI: All of the new classes are being recognised, but not the properties/methods.