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

same prob here.. why does the "spriteName.z = 200;" cause errors but "spriteName["rotationX"] = 200;" doesnt??

how to fix?

For now, this is expected behavior.

Cheers,
Jono

Yes. Got it compiling in Flex Builder 3 & Mac OS X 10.5.

To get rid of 'abc bytecode decoding failed.' error:
1. Open your project properties
2. Under "Flex Compiler" choose 'Configure Flex SDKs'
3. Add your new Flex 3 nightly build SDK folder to the list.
4. Choose the new Flex SDK as your compiler for this project.
5. Make sure to set HTML Wrapper|'Require Flash Version" to 10.0.0 or Flex will not recognize new FP10 commands.

To Debug in Flex:
1. download player from link Jeff posted: http://opensource.adobe.com/svn/opensource/flex/sdk/branches/3.0.x/in/player/10/
2. Do whatever you need to do in your OS to ensure SWF files are default opened by the new Flash Player 10 debug app
2. Open project properties
3. Goto 'Run/Debug' settings
4. Select your project name & then click 'Edit'
5. URL or Path to launch: Uncheck Use defaults
6. In the 'Debug' field, browse for the actual .SWF file of your project instead of the HTML wrapper.
7. Run debug & tell Flash 'Yes' to try to connect using current version.
8. Flex should launch your application SWF which should open in the new Flash 10 debug player..which will connect to Flex Debugger.

Anyone else have an easier way to debug?

Cheers,
J

Posted by Jason Lewis at May 19, 2008 23:47Updated by Jason Lewis

I can't help but wonder how anybody has ever managed to succesfully compile a Flash 10 app from Flex Builder?!?

Downloaded the latest 3.0.2 SDK today and, ok my app compiles, but it wont run because the browser (Firefox 3, Safari 3.1.1 - OSX 10.5.3) claims the necessary Flash Player is not installed.

Turns out that in the html wrapper DetectFlashVer(10, 0, 0) resolves to false, because the function GetSwfVer() (AC_OETags.js) is returning "10.0.b218" and the 'b' is screwing things up.

Edited the function, to filter out not just 'd' and 'r' but also 'b' and now everything works.

Is this an oversight in the SDK? Will it be corrected? Or what did I do wrong? How the heck has anybody anywhere ever managed to compile and run a Flash 10 project, using the default AC_OETags.js file?!?

Thanks Richard; I patched this in 3.1.0.

In the future, please file a bug in JIRA so we can get it fixed faster

Anybody having trouble with the new beta? I have found that it doesn't display my 3D objects.

I downloaded the latest nightly build(3.1.0.2312) and followed the instructions above for command-line compiling. No problems when compiling but no 3D. Tried <target-player>10.0.0</target-player>, <target-player>10.0.0.525</target-player> and <target-player>10.0.525</target-player> with same results.

I was able to go back to the first beta and everything works fine. Any ideas what I am missing?

I had the same issue after downloading flash player 10 beta 2. It was resolved after downloading flex_sdk_3.1.0.2418 and rebuilding my sources.

Flex SDK 3.1 will have full support for 10 beta 2 (10.0.0.525).

ok, i used the flash uninstaller to get rid of my flash 10 so i could install the flash 10 w/ debugger, but the debugger install pops up an error saying there is a newer version of this software currently installed. I know flash 10 is gone from my system (mac OS X) because i can no longer view the flash 10 demos.

is there a pref file i can manually delete somewhere to get the debugger installed.. its kind of a necessity.

do this (on osX)

take the flash 10 debugger.dmg and open it up and then right click the package(dont install it)
then extract "Archive.bom" somewhere like desktop.. this has the files in it you need

copy "Flash Player.plugin" and also "flashplayer.xpt" to /Library/Internet Plug-Ins/
you should replace the current files

there is also a file "version.txt" that i think was suppose to go in ~/Library/Preferences/Macromedia/ but it doesnt seem to have one to overright.. but this path was in the installer script.. so i dunno.. maybe isnt used anymore.. opening that file with textmate shows the version number to be wrong anyway..

If you find this is still a problem, would you please file a bug at https://bugs.adobe.com/jira/browse/FP with the steps you found to fix the problem?

I have installed the latest nightly build (3.1.0.2511) and everything is working well except that I dont have the graphics and bitmapData library.

does any one have a solution ?

in case anyone else is coming across this problem.

This is already logged in JIRA see http://bugs.adobe.com/jira/browse/FB-15787

The work around is simply manually add:

import flash.display.*;

or

import flash.display.BitmapData;

eh voila!

Careful though if you use 'import flash.display.BitmapData;' FB sometimes cleans up your imports and it will dissappear.....

Posted by Luke Lincoln at Nov 04, 2008 09:58Updated by Luke Lincoln

does anyone maintain this post? is there a better place to discuss troubles with flash 10? another adobe forum somewhere that has more steady traffic? the fact i have been messing with the same issues for over a week makes me want to just out off flash 10 because there seems to be 0 supprot for it.

This is definitely not the place to ask Player 10 questions. This post is strictly about getting the SDK to successfully compile to target FP 10. FP10 is in beta, there is no official support for it yet, though there is the Adobe Labs forum

Maybe i have dumb question, but it is possible to use Flash Player 10 features in my AIR application.

I have succesfuly integrated lastest Flex SDK (3.0.3.2490) in Flex Builder 3 and instaled Flash Player 10 in my system, but each compiled AIR application using Flash Player 9 (9.0.124, determined by Capabilities.version). Compiled Web Application using Flash Player 10.

(- sorry for my english -)

Posted by Petr Cihelka at Jul 25, 2008 09:35Updated by Petr Cihelka

Not at this time, sorry.

  • Jono

Hello,

I don't know if this is a limitation of Flex Builder 3 or a misconfiguration. If this is a bug, I'll fill a JIRA issue as soon as this is confirmed.

I have two projects in a new workspace, using Flex Builder 3 (Plugin version, with Eclipse 3.4.0): MyLibrary (Flex Library Project) and MyProject (ActionScript Project). Both of them are using the Flex SDK 3.2.0 build 2767. The MyProject project uses MyLibrary as a library project defined in its class path.

In the MyLibrary project, I have two classes: the first one doesn't use Vectors (ClassWoVectors), the second one does (ClassWithVector). The project is compiling without any error, and the SWC is properly generated.

In the MyProject projet, I create a new application. When typing the first letters of the classes in my library (says 'Class') and typing Ctrl+Space, there is only one of the two classes appearing: the one without Vectors.

Is this a misconfiguration on my part? Or a bug in Flex Builder and/or the SDK?

Thank you very much.

Thanks Samuel – that's a very interesting behavior and we'd like to test it and see what you're seeing. Would you file a bug against Flex Builder's Code Model (please don't file against Flex SDK)? Give it an important sounding title, vote for it, and if you can... can you create the projects in a way that reproduces this and File|Export them so we can import exactly what you're seeing?

  • Jono

Bug is filled:
https://bugs.adobe.com/jira/browse/FB-13863

A full workspace to reproduce it is attached to the ticket.

Thank you, I hope this bug will be fixed soon, there is no way we can use Flash 10 from our project with our current workflow if it is not.

I am also stuck because of the i don't have flashplayer 10's "playerglobal.swc"

so anyboday tell me how can i get that?

It's part of the Flex 3.1 SDK in branches, and the Flex 4 trunk on svn: http://opensource.adobe.com/wiki/display/flexsdk/Developer+Documentation

i have installed nightli sdk 3.2.0.3244 and also installed FP10
i also configured my flex builder 3 and my project settings properly

but i do not know how to use new right to left features by fp10

anuone can help me please?

thank you very much

When i use "playerglobal.swc" from 10, Graphics and BitmapData classes are not available. any ideas?

SDK 3.2.0.3643, 4.0.0.3739

Thanks

You mention two SDKs, unavailable in both? You need to be sure you are using "-target-player=10", which is the default in 4.

Is there a way to compile Flash Player 10 content, with SDK >= 3.2, but only require FP9 from the users?
Here's the use case: I would like to use the new FileReference.save method with FP10 users, but offer FP9 users the ability to use the app and save locally using the old approach: save on server first, then download. I don't really want to impose FP10 for that sole reason, as the old approach still works after all

I've changed all SDK settings and my app compiles and runs correctly on both FP9 and 10, but the only way I can get Filereference.save() to work is by requiring FP10 in my html wrapper, which sounds a bit weird? Is there something obvious I'm missing here?

Thanks a lot,
Jerome.

Forgot to mention that, obviously, the idea here is to differentiate FP9 and 10 users directly in AS using Capabilities.version:

  • majorVersion >= 10 : simply use FileReference.save
  • others: save on server then download

That bit is working just fine, my question is really about the compiler settings to set to be able to compile FP10 content, accessible to FP9 users, if possible?

Cheers,
J.

Unfortunately the Player doesn't enable its new APIs in SWFs that target an older Player. So your SWF will need to target Player 10 in order to leverage those features. One reason we do this is because we don't want to accidentally stomp on methods that customers may have created in their subclasses, etc.

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,

View the rest of this thread. Most recent comment: Oct 26, 2008
2 more comments by: Jerome Cordiez , Matt Chotin

I have an Air application built with Flex Builder. It does things with video. I am extending it to work with .f4v files. To work with .f4v I need to be able to get the onXMPData event. To do that I believe I need to target Flash 10 (the NetStream class as described in the Flex 3 AS DOC does not have onXMPData, the NetStream class in the Flash 10 AS DOC does have onXMPData).

What do I need to do? Thanks.

I Configured Flex Sdk As Mentioned Above But I am Having This Error In Design Mode.

"This Component is based on a Component which is not a visual component.Switch to source mode to edit it."

May be there are errors in the this build of flex sdk . i am using

sdk build date : Wed Nov 12, 2008

Or some other problem . what you guys suggest ?

What component is it complaining about? It's possible that the last 3.2 builds of the SDK won't work with the Design View of 3.0.1 (or 3.0.0) and that the 3.0.2 update which is expected next week will fill.

hi !
whether the modification above is fit for the AIR application building in flex3.2,when I create some 3D effect or animation?

Hi
I have Flex Builder 3 installed on Mac. I have Flex SDK 3.2.0.3958 and 4.0.0.
With 3.2.0.3958 I followed your instructions, 4.0.0 should point to Player 10 by default.
The problem is I don't see code hints in Flex Builder 3 Standard edition (build 3.0.2.214193)
Builder doesn't hint Player 10 functions for both SDKs and does not allow to compile with fl package.
If I add
import fl.controls.Label;
Builder hints it "1172: Definition fl.controls:Label could not be found"

looks like when targeting Flash player 10, the Flex builder profiler no longer works? Can anyone from Adobe confirm this?

Should work with 3.0.2.

I've followed all the steps here, but I still can't get Flex to compile and run my apps in FlashPlayer 10 without using the HTML wrapper. I prefer to test without launching the browser so I disable the Generate HTML wrapper file option. When I build and run it that way, it still builds using FP 9.

thank you. i did not find any problems with my adobe services.