Joeflash’s Enigmacopaedia


Creating FP10 SWFs in Flash CS3: A Failed Experiment

Posted in Flash, Adobe, Flash Player, Flash CS3, Flash CS4, FP10 by Joeflash on the November 8th, 2008

Since I wrote the tutorial on compiling for FP 10 in Flex Builder 3, I wondered if there might be a way to compile Flash 10 SWFs in Flash CS3, and thought this would make a great sequel. Problem is, the experiment didn’t work. You can create FP10 SWFs in FLCS3 if you’re desperate, but for the hacks and handicaps you’ll have to put up with, you might as well use Flex Builder or MXMLC from the Flex SDK. Here’s why:

First, the steps to reproduce my experiment:

1.    Create a new Flash version profile file.

This step is actually taken from a tutorial I found here, which is the only reference I have found of anybody being successful at this. In the C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Players directory, you copy either the AdobeAIR1_0.xml or the FlashLite3_0.xml file and create a new file named FlashPlayer10.xml.

2.    Replace all instances of “Flash Lite 3.0″ or “Adobe AIR 1.0″ with “Flash Player 10″, and each instance of “Adobe Flash Lite” or “Adobe AIR” with “Flash Player”.

3.    Comment out all the “feature” tags. I don’t know what they do in this particular instance, but didn’t seem to make any difference to the compilation process.

I’m not too sure what the “path” tags do either for that matter, but my experiments worked fine even though my XML was pointing to a Flash Lite or AIR dll file. I tried to point them to what I thought was the equivalent Flash .dll file, or omit them altogether, but I got startup errors.

4.    Launch Flash CS3, and set the Publish Settings > Flash > Version to the new “Flash Player 10″ profile.

5.    In the ActionScript 3.0 Settings, disable ‘Strict Mode’ and ‘Warnings Mode’, so you don’t get compiler errors, because the Flash compiler does not recognize the new classes. But the Flash 10 Player will, so I guess that’s what matters.

6.    Author your application with FP10 classes. The code for my test was simple:

  1. import flash.system.Capabilities;
  2. trace("Flash Player version: " + Capabilities.version);
  3. version.text = "Flash Player version: " + Capabilities.version;
  4.  
  5. import flash.display.Stage;
  6. import flash.display.ColorCorrectionSupport;
  7. stat.text = "Color Correction Support = "+stage.colorCorrectionSupport;
  8.  
  9. import flash.display.MovieClip;
  10. box3D_mc.rotationZ = 20;
  11. box3D_mc.rotationY = 50;
  12. box3D_mc.rotationX = 10;
  13.  
  14. import flash.display.Shader;
  15. var myShader:* = new Shader(); //works
  16. //var myShader:Shader = new Shader(); // does not work

7.    Do not use Publish Preview (F12) or Test Movie (Ctrl-Enter) to compile the SWF. Use Publish (F12), and preview the SWF in a browser with FP 10 installed, so you don’t get runtime errors.

And you will be able to compile Flash 10 SWFs. Below is a pic of the test that I came up with.

Flash Player 10 test

But this technique carries with it some significant disadvantages:

1.    No FP10 class code hinting. The Flash IDE code editor sucks anyways, so I don’t see this as too much of a negative. :P

2.    The reason you get runtime errors if you preview or test in Flash is that there is currently no updater available for replacing the Flash authoring player, which is actually the authplay.dll file located in
C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration.

I thought at first that you could substitute the Flash CS3 FP 9.0.124 updater for the Flash CS4 FP 10.0.12 updater, since they’re basically the same files. But it turns out that the Flash CS3 9.0.6 Updater for Flash Player 9.0.124 doesn’t update the authoring player — it’s just a zip with a “\Player” folder to replace the default “\Player” folder in the installation directory. Which has installers for browser players and standalone players for creating projectors. But no authplay.dll. So it’s completely useless, so as an updater I consider it to be broken. Cause I don’t know about you, but I would not create a projector when we now have AIR to create Flash on the desktop. And I don’t have Flash CS4, but I gotta wonder if the FLCS4 FP10.0.12 updater replaces the authoring player either. If I still used Flash authoring all the time I’d be pretty pissed.

Update: running the standalone FlashPlayer.exe does reconfigure the SWF file association in Windows for playing SWFs in standalone mode, so I guess it does have some usefulness, but it still doesn’t affect SWF previewing in Flash authoring.

3.    The default version detection in the HTML publish settings shows detecting version “0.0.0″, because evidently it can only accept one decimal place for the major version. So you can’t use version detection for the default HTML template.

You may be able to get around this by creating your own HTML template, I dunno, I didn’t bother to find out. Even if it does work with a custom template, that’s still yet another hack to put in place to get this to work.

4.    And here’s the deal breaker: you cannot use any of the new FP10 classes as the type declaration in a statement, even if you turn off compiler warnings, so it would seem. See the last two lines of code in my example: the first line works when declaring an untyped variable, but the moment I type it to the Shader class, the compiler throws up on me. This, more than anything else, is why the experiment was a failure. I could live with no compiler checking, since I’d probably be using Flex Builder to author the files anyways. But if I wanted to use the Flash compiler, no strong typing. That seals it for me.

Here are some other things I tried as workarounds which did not work:

•    Substituting the FP10 playerglobal.swc for the default playerglobal.swc located in C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\ActionScript 3.0\Classes did not work. Flash CS3 will load with an error if you try to do this, it really does not like that other SWC.

•    Pointing to the FP10 playerglobal.swc in the ActionScript 3.0 Class Path setting, which I have installed with the Flex 3.2.0.3794 SDK at C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0.3794\frameworks\libs\player\10\playerglobal.swc. See my previously mentioned tutorial for details on compiling for FP10 with FB3.

This gets rid of the FP10 compiler errors all right, but it interferes with the working of basic classes such as System.Capability.version, and will not compile the FP10 classes, probably due to namespace or class conflicts.

•    I can use FP10 features with strong typing and compiler warnings, in some limited cases, if I stick to new methods on existing classes and don’t use any of the new classes. Which is a such big limitation as to make it useless. So you can’t use compiler warnings or strict mode under any circumstances.

In conclusion, I think there’s way too much voodoo happening in Flash Authoring for compiling to a new version of Flash to be a simple thing. I mean, I’ve been using Flash for some time, and there’s undocumented stuff going on behind the scenes I still don’t get. Which is actually one of the reasons I switched to Flex a few years ago: at least you know what you’re getting when you compile something, and there’s a chance to understand the process because it’s based on an open source editor (Eclipse). Of course, if I were still a designer or even an interactive developer, I would not need to know all the geeky stuff. So it’s all relative, I guess.

In any case, for those interested here are the files that I used, you can download the zip from here.

I think there’s some truth to the rumour that Adobe has a profit motive to force people to upgrade to Flash CS4 as reason for not to providing a FP10 update for Flash CS3. But given how much I had to change in settings just to get partial FP10 compilation functionality working, it’s not surprising that they’d rather put their efforts into supporting the most recent version of a product rather than providing legacy support. I’m not saying I agree with it, but I understand why they’re doing it this way.

So I think I’ll stick to Flex Builder for authoring Flash 10 applications. It’s a shame that Flash folks who don’t have access to Flex Builder and don’t want to be forced to upgrade to Flash CS4 cannot compile for Flash Player 10 without some major handicaps. My recommendation for you Flash folks is to use FlashDevelop, which can compile to Flash 10 now.

3 Responses to 'Creating FP10 SWFs in Flash CS3: A Failed Experiment'

Subscribe to comments with RSS or TrackBack to 'Creating FP10 SWFs in Flash CS3: A Failed Experiment'.


  1. on November 18th, 2008 at 1:25 pm

    You’re right the workaround is not a complete success so it’s a failure for a complete substitute for FP10 authoring in flash CS3. HOWEVER, if you have an excellent decompiler and winrar on your computer you can create a complete authoring environment in Flash CS3. (Still not being able to use the test swf player in the IDE though). I tried also to download the CS4 update and use something in there and also found it to be useless. What you need to do is download the flex nightly build SDK and extract that zipped packaged. Look for the globalplayer.swc file and make a copy of it. Rename that swc extension to .rar or .zip (not tested with zip). Use winrar to extract it’s contents. What you’ll find in there is an xml file and a swf file. THIS is what flex/flash uses to type-check all classes and so on inside the flash/flex IDE. The swf file you extracted contains only actionscript and you’ll notice it’s 174 KB. Lots of code, that’s cause it’s the complete up-to-date as3 code library. If you use a good decompiler like soThink you can extract all of the classes in that swf file. If you then copy those classes into a custom class folder for flash cs3 you can now import every single class available for the current version of flash player. So there is your complete success for authoring flash player 10 content in flash cs3.

  2. ak said,

    on March 17th, 2009 at 10:24 am

    joeflash-
    dude, you rock, this worked perfectly for my situation.
    I really just wanted to use a few new methods of flash 10 like the save() method, and these methods worked great, as a side note, I also had to
    change a couple of other files to get it to work for a projector file on mac and pc. First the players directory needed to be updated to have all flash player 10 files, also in First Run>Publish Profiles>default.xml I had to change all the publishing versions to “0″ from “9.”
    The .app and .exe still say version 9 in the properties, but they open in flash 10 and the flash 10 methods work.
    thanks for the great work
    ak

  3. Petit said,

    on August 23rd, 2009 at 4:18 pm

    Hi, and thanks for this enlightening article.
    The whole thing seems much of a mess to me, and thanks to your thorough testing, I know I’d want to fin some other solution. Hopefully FlashDevelop will do the trick, although it seems to have a problem with generics (.)

Leave a Reply