How to compile for Flash Player 10.2 with Flash CS5

This post is for people who are using Flash Professional CS5 that want to make use of all the cool new features in Flash Player 10.2. Sure, you can use Flash Builder and the latest Flex SDK to do it, but currently there's no officially supported way of doing it with Flash Professional CS5. There is, however, a work around that I'd like to share!

You can follow the steps outlined below if you want, or take a shortcut and jump to the end of the article where I have all the files you need available for download. The downloadable zip contains a readme file with further instructions.

First, you will need to download the latest Flex 'Hero' SDK. You can grab that here. Go ahead and just download the latest release (4.5.0.19786 at the time of this writing). Once you've downloaded the zip, extract the SDK to the location of your choice. The reason we do this is because we need the 10.2 playerglobal.swc file that's included in this download. From the root of the SDK folder, this file is located in frameworks\libs\player\10.2\playerglobal.swc.

The next step is to go to the Flash configuration directory; the default path for this on a 64 bit, Windows 7 box is:

C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration

From there, step into the ActionScript 3.0 directory and create a new folder named FP10.2. Now copy and paste the playerglobal.swc file mentioned above into your newly created FP10.2 folder. The swc is in place, but we're not quite done yet. Next, step back up to the Flash config directory and from there, go into the Players folder. You should see a bunch of XML files. Copy and paste the FlashPlayer10_1.xml file to your desktop; go ahead and rename it to FlashPlayer10_2.xml. We need to make a few edits to this file so open it up and make the following changes:

-In the player node, change the id from "FlashPlayer10" to "FlashPlayer10.2"
-In the name node, change the text to Flash Player 10.2
-In the playerDefinitionPath, change the as3 attribute text to "$(AppConfig)/ActionScript 3.0/FP10.2/playerglobal.swc"

When the changes are complete, copy and paste the file into Flash configuration\Players directory where you initially copied the xml file from. Again, on a 64 bit Windows 7 machine that path will default to:

C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Players

If you've done all this correctly, you should restart Flash and open a new file. Go to the Publish Settings (CTRL+SHIFT+F12), click on the Flash tab and you should see an option for Flash Player 10.2 in the Player drop down as in the image below.

Congratulations! Now you can utilize the Flash Player 10.2 features with the Flash Professional CS5 IDE. To test it out, try setting the player to Flash Player 10.2 and click OK. Open the Actions Panel (F9) and type the following: import flash.events.

If the installation was a success, you should be able to see the various StageVideo events in the pop up code hint!

As mentioned at the start of this article, I've packaged up all the files you'll need in this zip. The zip includes instructions on how to install the files and how to test them out!

Bookmark and Share

17 Responses to “How to compile for Flash Player 10.2 with Flash CS5”

  1. vico says:

    Thanks

  2. OMA says:

    Hey, thanks a lot for this easy explanation on how to update Flash CS5 to use the new features in Flash Player 10.2! It was just what I needed!!! :-)

    I found some additional instructions here:
    http://tikiroomtiki.blogspot.com/2011/04/how-to-use-flashplayer-102-and-103.html

    Basically, you should also change version=”10″ to version=”11″ en the player node, so the Flex compiler uses 10.2 (add version=”12″ if you want to use Flash Player version 10.3 instead). So that line would look like this:

    Thanks again!
    OMA

  3. OMA says:

    It seems the code I wrote above was mistaken for HTML code. I’ll try again. I mean to say that line would look like this:

    <player id=”FlashPlayer10.2″ version=”11″ asversion=”3″>

    kthxbai! ;-)
    OMA

  4. Andy says:

    Hi, I’m using CS5 + AS2 and for some reason, when I’m using Camera class and previewing the movie inside Flash CS5, it will crash when I close the preview.. It also crash even when I load the SWF through standalone projector.

    When I traced the Flash version using System.capabilities.version, it says WIN 10,1,52,14

    So I’ve downloaded the latest standalone projector and run the SWF directly from the new projector, now it shows WIN 10,3,181,26..

    ‘ve changed all projector files to the latest .exe in “Adobe Flash CS5\Players” folder, but when I preview the movie (Test Movie) inside CS5, it still shows WIN 10,1,52,14..

    But when I published the movie as SWF and EXE, those files were compiled and run on the new version and it won’t crash anymore.

    Do you know any way to fix this problem? Basically I need Flash CS5 to preview the movie using latest version so that it won’t crash anymore..

    I’ve tried what you’ve said in the article.. but even thought now I can use the StageVideo events, when I checked the version in AS3 code it still shows WIN 10,1,52,14

  5. Rhuno says:

    Sorry Andy, I don’t know what the issue is. I do know though, that you cannot use AS2 with stage video stuff.

  6. Randy says:

    Just got my upgrade to Flash CS5.5 – it is set up for 10.2 and AIR 2.6. Any idea how I can change this to 10.3 and AIR 2.7. Found no help at Adobe – unless I am looking in the wrong places.

  7. Rhuno says:

    I’m not sure; I haven’t upgraded to 5.5 yet. I need to do that!

  8. Fygo says:

    I did everything like written above, I could import the events without problems (they showed up in the list) but after compilation I get this: VerifyError: Error #1014: Class flash.events::StageVideoAvailabilityEvent could not be found.

    Any ideas appreciated! Thanks!

  9. dhbrown says:

    @Fygo, @Andy,

    It seems that Flash Pro does not use the installed version of the stand-alone flash player when doing a ‘Test Movie’ [Ctrl-Enter]. See http://swfhead.com/blog/?p=575

    The swf is good for 10.2, but the built in player is bad (10.1.52.14), hence Fygo’s VerifyError. Testing with debug instead of test movie will work, or test outside of the IDE with the standalone player or web browser. Yes, it is lame.

  10. Rhuno says:

    Nice! Thanks dhbrown!

  11. pfg says:

    thanks! and thanks for using a site that doesnt make me register to say thanks!

  12. bintjes says:

    Thanks ! This is great ! I don’t use Flex, have only a Flash CS5 and am supposed to do a mp4 player with StageVideo ! In other words : you saved my a*** !

  13. bintjes says:

    .. oh wait..not quite … it seems that flash.events::StageVideoAvailabilityEvent is not implemented in the super swc (even if it’s proposed in the editor) and so it’s not possible to use StageVideo at all.
    You can compile through “publishing” without errors (inbstead of CTRL+enter) , but i now have an uncatchable problem : Stage does not seem to have depths to host StageVideo objects , and so nothing happens.

  14. Rhuno says:

    @bintjes

    Try dhbrown’s suggestion; use a stand alone version of the flash player (10.2 or above) to test your content.

  15. Mariana says:

    THANKS! I LOVE you Rhuno!!!

    All I need is to pass a variable from a parent to a child swf and I want to use the parameters property of the LoaderContext class.

    Its amazing how adobe in their greed to push us to discard our trusted old tools (and force us to buy their new ones) have always had trouble with passing variables between swf files; remember the as2/as3 and the flash/flex migrations?

    Again, you saved me from having to rewrite a lot of code just to pass a stupid parameter.

    Mariana

  16. SDDev says:

    One small note: if you want to make the Flash Player version detection form work correctly after making the changes described here, you will need to modify the file PlayerVersions.xml which originally comes from C:\Program Files\Adobe\Adobe Flash CS5\Common\First Run\Detection. You need to add a definition for the new player target.

    This is the form on the HTML tab of the Publish Settings form. Otherwise it leaves the major version as 0 and doesn’t properly generate the desired HTML for player version detection.

  17. John McDermott says:

    Note well, that if you upgrade the playerglobal.swc, FlashPlayer.exe and FlashPlayerDebug.exe For Flash CS6 (and 5 I believe) it does NOT change the player that Flash uses to “test” with (i.e. CTRL+Enter). The debug Player will be updated though (i.e. CTRL+Shift+Enter).

    I updated to FP 11.9 but CTRL+Enter still uses 11.4 as is revealed by tracing “Capabilities.version”.
    – CTRL+Enter -> 11.4
    – CTRL+Shift+Enter -> 11.9
    – double click SWF -> 11.9
    – in Firefox browser -> 11.9

    As long as I use the Debug player (i.e. CTRL+Shift+Enter) or choose Publish from the file menu the code is OK both in the stand alone Player when you double click a SWF, and in a browser.

Leave a Reply

Subscribe to RSS feed FGS5 Badge