Menu

Targeting Flash Player 10

SourceForge Editorial Staff

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 4 SDK only targets Flash Player 10.

Text in **red** has been updated for FB 3.0.2.

First Things First

Grab 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 Compiler

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:

.

<target-player>10.0.0</target-player>
  • In <external-library-path>, edit the path-element for playerglobal.swc, replacing 9 with 10:

.

<external-library-path>
    <path-element>libs/player/10/playerglobal.swc</path-element>
</external-library-path>
  • Do the same with <library-path:

.

<library-path>
    <path-element>libs</path-element>
    <path-element>libs/player/10</path-element>
    <path-element>locale/{locale}</path-element>
</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}:

.

<external-library-path>
    <path-element>libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
</external-library-path>
  • Do the same with <library-path>:

.

<library-path>
    <path-element>libs</path-element>
    <path-element>libs/player/{targetPlayerMajorVersion}</path-element>
    <path-element>locale/{locale}</path-element>
</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). It's left as an exercise for the reader :)

Flex Builder Application Projects

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.2.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".

Related

Wiki: Downloads
Wiki: Using Flex 3 Builds in Flex Builder
Wiki: Using Gumbo Builds in Flex Builder
Wiki: downloads

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.