1
votes

I am new to creating Flex applications and trying to target Flash Player 10.2 with my first. I have created it using Flash Builder 4.6 and compiled using the 4.5a SDK. I've also set the option to target 10.2.0 in the the Adobe Flash Player options. When I create the release build, there are no error and the resulting HTML file contains the following:

// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
var swfVersionStr = "10.2.0";

However, if I try to visit the application in a browser with v10.2 of the plug-in it says 11.1 is needed. I also have the same problem with a simple Flash CS5 animation that only uses stop() and getURL(). The animation works but doesn't stop.

Thanks for the detailed reply wxvxw I've now taken a screenshot of my compiler options, but can't show it here as I'm a new user, but the URL is...

https://lh6.googleusercontent.com/-3xEJ0RTFG-8/Tw9rJt2UloI/AAAAAAAAARs/Ruu9Em66fgo/s800/fboptions.PNG

I've tried -target-player 10.2.0 (previously) and now -target-player 10.2 but neither worked. I've also located the playerglobal.swc in the following directory: C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.5.0\frameworks\libs\player\10.2

Thanks. Dan.

2

2 Answers

3
votes

IIRC, the SDK that comes with FB 4.6 only has FP 10.1 and FP 10.3 libraries. So, in order to compile for FP 10.2 you will have to find the corresponding playerglobal.swc (maybe look up older SDK releases?).

Now, regarding your settings: the version of the player you want to compile for is set in the compiler arguments, there are multiple ways to do that, but it looks like you've done something else instead :) In order to compile for certain player version, the compiler needs to know how that version of the player behaved, that is it needs a description of all the built-in functions the player had at that time. playerglobal.swc provides the definitions for those functions (search your SDK folder for the possible location). -target-player is the compiler argument that you need. One way to tell the compiler what player to target is to open the project settings and in the additional compiler arguments line type something like -target-player 10.2. Note that you might not have the appropriate playerglobal.swc. The compiler error in such case will roughly point you to the directory where this library is to be found.

Flash Builder and SDK had never had 11+ player as a requirement, (more yet, the SDK has not even been tested against this version), so the requirement is unrelated (did you use Google Chrome for testing, maybe you need to check about:plugins page?). What you did set is some variable that is supposed to tell the JavaScript script that is used to embed the SWF, what minimum version of the player is required to run the SWF, this has no effect on the SWF itself, it's only for user's information (you should set it in such a way, that in case users have older version of player they will be told to upgrade). If you used FB's code generation, or the Ant task provided by Adobe to generate the HTML page containing SWF, then this variable would be set to the same version you used to compile your SWF to, otherwise it's up to you to adjust it to the proper value.

3
votes

I was having the same experience, but it wasn't a matter of flash not being installed. I had set my project in flashbuilder 4.6 to build using a specific SDK (Flex 4.5.1A) and a specific version of Flash player (10.2.0) but my client was unable to play it in flash 10.3 (they are limited by their IT department to that version, still)

my fix: add -swf-version 10 to the additional compiler arguments

I had dug around and found that the 4th byte of the swf file indicates what version of flash it's built for; when I did an export to release build, the 4th character was hex 0B rather than 0A.

I ran the swfdump.exe that was in the sdk bin and found the version was 11 <swf xmlns='http://macromedia/2003/swfx' version='11' framerate='24' size='10000x7500' compressed='true' >

I added the following to get the config that flashbuilder was using to build the project -dump-config c:\testconfig.xml

in that, I found <swf-version>11</swf-version>

based on that, I guessed that the flag I needed to set was the -swf-version 10 as an additional compile parameter in the project properties > Flex Compiler

after building with that flag, the swf version was 10 in both swfdump and the config dump