How to enable LZMA compression in Flash Player 11? - apache-flex

As mentioned in release notes to Flash Player 11, developers added LZMA compression support.
Question is how can one enable this support? Maybe there's an mxmlc option? Or more steps?
Simply setting -swf-version=13 and switching playerglobal.swc in sdk didn't work for me.

SWFs compiled with the -swf-version=13 parameter automatically support LZMA compression, meaning that LZMA compressed SWF files can be loaded at runtime, however the SWFs output by Flash Builder (as of 4.5.1) are still compressed with the default zlib compression.
Tinic Uro, one of developers of Flash, wrote a utility to convert SWF files from the default zlib compression into lzma. This would need to be done as additional step after compiling, at least until Flash Builder starts supporting LZMA output.
Update (clarification):
The flex SDK does not yet output LZMA compressed SWF files no matter what options you use, which is why the utility is needed. The 'swf-version' compile parameter tells the SDK to output a Flash 11 SWF. This is does not mean that the SWF is compressed with LZMA compression, just that it is able to use it. The gist of this is Flash 11 is able to support LZMA compressed SWFs, but you need to do additional work to actually make a LZMA SWF.

I wrote a Python script that will do this conversion based on Tinic's code. It's a little easier to use if you're not on Windows.

Related

How to create and modify .doc and .docx file in Qt?

I want to create and modify .doc and .docx file in Qt creator with ability to compile for Windows, Linux, Android and IOS.
This is not a Qt-specific question imho. Anyhow here is my answer:
Quoting wikipedia:
is a zipped, XML-based file format
What this means is you need to decompress (you need to figure out how it is compressed to begin with) and process the XML for doc files. Qt provides basic (de)compression facilities and does provide the tools to process XML data.
In terms of Qt Creator - you have to write your own plugin for that purpose. You can check what's already there - processing of CMake, C++, C, Python files.
You should use what's already there. LibreOffice for example, which is open source and free, can handle such documents (incl. doc). There are libraries that do that too. So your best bet is to integrate some library into your Qt application. I would NOT recommend implementing it yourself unless you have a lot of spare time. The fact that big projects such as LibreOffice, OpenOffice etc. still don't have 100% support for such documents should give a big enough hint that it's not a trivial task.

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

Does Flash Builder 4.6 create LZMA compressed SWFs?

Does Flash Builder 4.6 create LZMA compressed SWFs and also are the RSL framework LZMA compressed?
No. Falcon may add support for this. There are supposed to be programs out there that can compress the file after the fact. Though I don't know what those are.
The entire SWF file is not compressed, though elements within the file - images, ActionScript bytecode, sounds etc - are individually compressed in blocks (I believe zlib is used). This is important for the flash player to be able to decompress parts of the swf as it loads, in order to get it playing quickly.
Usually you won't get a lot of extra compression by compressing the entire SWF file, since most of the data inside is already compressed.

Large flex project, how can I convert my swc libraries to a RSL?

my Flex project has grown to over 1 Mb in size in release mode and now I am trying to cut it up into modules.
One of my SWC libraries is fairly large and I want to use it in multiple modules, so I think I can turn it into a RSL? how can I go about turning the SWC library into a RSL? I am building with Flash Builder (Flex).
You can pass the following parameters to mxmlc compiler:
-runtime-shared-library-path=path/to/your_lib.swc,http://lib-url/your_lib.swf -verify-digests=false
Pay attention, that for linkage you should use SWC, but rsl you're going to load, should be an SWF (not SWC). To get SWF from SWC: open *.swc file with archiver (e.g. WinRAR) and extract *.swf from it.

Is it possible to start an Adobe Flex app on OS X with just the AIR runtime and the .swf

I know it is possible to run an Adobe Flex compiled .swf from the command-line using the adl command-line tool.
Is there an equivalent way to run a Flex .swf from the command-line using the system installed AIR runtime?
My question applies to OS X, but I'd interested to know about other platforms also.
UPDATE: This question is now somewhat obsolete. As of AIR 3, there is now an 'officially supported' way to bundle the AIR runtime with an application, using the 'captive runtime' deployment option.
I just tested to run an AIR app without the need to install the application.
Copy the following folders from your Flex SDK
bin
runtimes\air
as well as all files from your "release" (bin-debug) folder of your project.(Don't build a release build!).
now you can run the application with "adl app.xml".
Though there was AIR runtime installed on the PC I think it should be possible without it too.
The original question was a bit different though, maybe it's helpful anyway.
I say No! A SWF is not the same as an AIR application. If you take that SWF's code and compile it into an AIR application; then you should be able to install and run it independent of the browser or any development tools.
I suppose in theory you could create an AIR application where you give it the location of a SWF and use SWFLoader to load the actual SWF. I don't think that is quite what you're after.
There is a stand alone Flash Player which is different from AIR and different from the browser plugin. You can get it here. You can use that to run the SWF as if it were a local app. I wouldn't count on your users having that, though.
You can also load a local SWF in the browser and let the flash player plugin handle it.

Resources