Loading an older version SWF by a newer version SWF - apache-flex

I have an Action Script project made with Flash Builder 4.7 and the AIR SDK 3.7. I want to load the swf that is packaged inside an AIR file created with Flash Builder 4 and the Flex SDK 3.5. I managed but its scaled about 300% and its shifted to the right too leaving a huge white border on its left side.
I read the following in http://help.adobe.com/en_US/air/build/WSfffb011ac560372f2fea1812938a6e463-8000.html#WSfffb011ac560372f2fea1812938a6e463-7fff:
When loading a SWF file of a different version than the loading content, you can run into the two problems:
-Loading a newer version SWF by an older version SWF— References to APIs added in the newer versions of AIR and Flash Player in the loaded content will be unresolved
-Loading an older version SWF by a newer version SWF — APIs changed in the newer versions of AIR and Flash Player may behave in ways that the loaded content does not expect.
I think the second is my case. My initial problem is described in http://mabulous.com/de/air-applications-that-can-be-updated-without-requiring-admin-rights and the solution worked for me only to lead to this new problem. Any ideas please?

Related

FlexVersion compatibility has already been read - _NOT_ Flex 3 to Flex 4 issue

To be clear, this code was working for many years using Flex 4.5.1. As such, this is not answered by; Error migrating Flex 3 to Flex 4
I am bulk generating Font CSS SWF in Flash Builder. There are nearly 700 of them, so I cannot do it in my main project, but have a related project to do so. Both projects are compiled using the same SDK (I have tried 4.6.0 (Adobe), 4.12.0 (Apache Flex), 4.13.0 (Apache Flex)).
However, since upgrading to 4.6+ from 4.5.1, I can no longer import fonts on demand as they immediately trigger Error: Compatibility version has already been read. error on load.
Can anybody direct me to a workaround for this? Or explain what causes compatibility version to be written on load of SWF?
See my comment above. This was resolved to inconsistent SDK in a complex build environment. Once everything matched (exactly) the issue disappeared.

Apache Flex 4.9.0 and minimum Flash Player version

Apache flex 4.9.1 needs minimum Flash Player 11.1.
I read that Apache flex 4.9.0 is working with Flash Player 10.2 is that right? I can't find it anywhere! Where can I download it from?
Thanks!
No need to build the SDK from scratch, Apache Flex 4.9/4.10/4.11 will work with Flash Player 10.2 and above out of the box, 11.1 is not the minimum version. All you need to do is change the configuration file (framework/flex-config.xml) to use 10.2 rather than the default 11.1 and download the correct player global swc. The Apache Flex README has more details instructions on how to do this.
https://github.com/apache/flex-sdk/blob/develop/README
Alternatively the installer (version 2.7 or above) will allow you the select the Flash Player version.
http://flex.apache.org/installer.html
That being said some features may work poorly (eg mobile components) and it hasn't been fully tested on Flash Player 10.2.

Flash Builder 4.6 not compiling for Flash Player 10.2

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

Can Flash Builder 4 Premium compile Flex Builder 3 Pro project?

That's about it. Oh, and I don't want to convert the Flex Builder Project making it incompatible with Flex Builder 3 Pro.
Yes! Here is an article and video that shows how to use the Flex 3 SDK in Flash Builder 4.
Yes, you can compile the project with Flash Builder 4. ISTR it either silently updated my project settings or I might have converted the project.
In any case, if you are trying to simultaneously use Flex Builder 3 and Flash Builder 4 you should note that at least one of the internal eclipse & FB project settings files (.actionScriptProperties, .flexProperties & .project) changed format between FB3 and FB4 - I can't remember exactly which ones changed off the top of my head.
This will affect your development workflow.
I have previously used Flash Builder 4 on a project whilst the rest of the team was using Flex Builder 3. Whenever they updated their project I had a lot of problems with conflicts in at least one of the above files. Whenever this happened, I just accepted the FB3 versions of the files, and let FB4 internally deal with upgrading the format. If I somehow needed to make changes to those files (such as adding a new class), I'd either get another team member to do it, use FB3 to add the files, or just manually edit the file myself. Irritating, but not the end of the world.
YMMV.
Yes. Adobe products are extremely backwards compatible. However, some Adobe products will by default save your "older" files into the newer format - ie if you saved your FB 3 project with the FB 4 application, you may have to choose "Save As" to force it to save it as version 3 (this is true at least for Flash, not certain if Flex is different in that regard). This is only relevant if you need to retain the older file format for compatibility with other coworkers who only have an older version of the program.

Flex project migration to 3.4 SDK

I migrate from 3.0 to 3.4 SDK and see the following bug in my flex project
VerifyError: Error #1053: Illegal override of FlexModuleFactory in mx.core.FlexModuleFactory.
How can I fix it
best
Vladimir
One of two things you are either trying to load a SWF that isn't a module as a module or you are loading a Module compiled with a different version of the SDK from the SWF doing the loading.
Make sure that the Module you are loading is also compiled with Flex 3.4. Cross SDK version support is not available in Module loading. If you need that functionality get all the loaded SWFs ( sub-applications ) up to Flex 3.3, then you can change the SDK version of the loading application ( parent application ) to whatever flex version you want. Read up on the Marhshall Plan for more information about sub-application loading.
-d
I'm getting the same error on a project. I suspect is has to do with a swc being compiled with an older version of Flex (say 3.2). I've seen similar issues discussed online with PaperVision. Unfortunately our project hasn't moved to 3.4 completely yet so I've not had time to recompile our various swc's to see if that fixes the the issue.

Resources