<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Targeting Flash Player 10</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Targeting%2520Flash%2520Player%252010/</link><description>Recent changes to Targeting Flash Player 10</description><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Targeting%20Flash%20Player%2010/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 15 Mar 2012 18:13:16 -0000</lastBuildDate><atom:link href="https://sourceforge.net/adobe/flexsdk/wiki/Targeting%20Flash%20Player%2010/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Targeting Flash Player 10 modified by SourceForge Editorial Staff</title><link>https://sourceforge.net/adobe/flexsdk/wiki/Targeting%2520Flash%2520Player%252010/</link><description>
# 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.

&lt;p style="color:red"&gt;Text in **red** has been updated for FB 3.0.2.&lt;/p&gt;

## First Things First

Grab a nightly build from [Download Flex 3](https://sourceforge.net/adobe/flexsdk/wiki/Download%20Flex%203/), 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 `&lt;target-player&gt;`, replacing `9.0.115` with `10.0.0`:
  
.

    &lt;target-player&gt;10.0.0&lt;/target-player&gt;
    

  * In `&lt;external-library-path&gt;`, edit the path-element for `playerglobal.swc`, replacing `9` with `10`:

.
  
    &lt;external-library-path&gt;
        &lt;path-element&gt;libs/player/10/playerglobal.swc&lt;/path-element&gt;
    &lt;/external-library-path&gt;
     

  * Do the same with `&lt;library-path`:

.

    &lt;library-path&gt;
        &lt;path-element&gt;libs&lt;/path-element&gt;
        &lt;path-element&gt;libs/player/10&lt;/path-element&gt;
        &lt;path-element&gt;locale/{locale}&lt;/path-element&gt;
    &lt;/library-path&gt;
    

&lt;br&gt;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 `&lt;external-library-path&gt;`, edit the path-element for `playerglobal.swc`, replacing `9` with \{targetPlayerMajorVersion\}:
  
.

    &lt;external-library-path&gt;
        &lt;path-element&gt;libs/player/{targetPlayerMajorVersion}/playerglobal.swc&lt;/path-element&gt;
    &lt;/external-library-path&gt;
     

  * Do the same with `&lt;library-path&gt;`:
  
.

    &lt;library-path&gt;
        &lt;path-element&gt;libs&lt;/path-element&gt;
        &lt;path-element&gt;libs/player/{targetPlayerMajorVersion}&lt;/path-element&gt;
        &lt;path-element&gt;locale/{locale}&lt;/path-element&gt;
    &lt;/library-path&gt;
    

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`. &lt;font color="red"&gt;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`.)&lt;/font&gt;

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. &lt;font color="red"&gt;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.&lt;/font&gt;

## 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. &lt;font color="red"&gt;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`.)&lt;/font&gt;
  * 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". &lt;font color="red"&gt;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.&lt;/font&gt;
    * 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".

</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SourceForge Editorial Staff</dc:creator><pubDate>Thu, 15 Mar 2012 18:13:16 -0000</pubDate><guid>https://sourceforge.netb94f2f34d63addce15462d2078cf7323d7bf1764</guid></item></channel></rss>