Flex swf file taking time to load at client side - apache-flex

In my project we have swf file that is 4 mb in size. When we open the application in browser it is taking 3-5 seconds to load the swf file at client side. Is there any way to compress the swf file and send so that it will take less time? Or is there any other options to minimise the load time?
Thanks
Sachin

By default swf files are already compressed when compiled. Try zipping an swf file for example it will hardly change in size.
If you find a compression method to do decrease the size of the swf and this compression method is supported by flash, you can compress the swf file for download and decompress it at runtime and then load it.

Read "Reducing SWF file sizes"
Use the bytecode optimizer
Disable debugging
Use strict mode
Avoid initializing unused classes
Externalize assets
Use character ranges for embedded fonts
Read "Reducing module size"
Change the application that a module is optimized for in Flash Builder
Create and use a linker report with the command-line compiler
Modularize your module
Compress your assets (higher jpg compression, lower color depth, etc)

Related

Which is the best approach while deploying qml files in embeded application?

I am working for an embedded project, UI developed in QML and backend logic developed using DB/other system calls in C++/Qt.
Which is the best approach to deploy qml files?
Does It adding to .qrc (as resource) and compile to executable application?
or
Load QML files from import folder (QML files will be deployed)?
or any other suggesion?
I have around 200 QML files.
QML files in the file system
Files are stored without compression and encryption
Faster to build but slower to deploy
Stored without compression so they take more storage space
Easy to do UI changes on the fly on target (just edit QML and restart)
QML files in the resource file
Resources are compiled to the binary file making the executable file size bigger
Slower to build but faster to deploy.
Takes less storage space because resources are compressed by default.
Because the executable size is bigger the program takes more memory when running.
You can't do changes to UI without re-compiling
See from the link the following chapter Managing Resource Files with the Qt Resource System for an example of relative path referencing.
I don't have any strong opinion but here some of my thoughts:
If memory usage is an issue then you might go without embedded resources and make sure you use dynamic loading of components as much as possible. In the development phase it's easier to go without embedded resources. If it's a customer project I would do the customer delivery as qml files embedded. This prevents the customer from tweaking the UI code themselves.

load different .qrc file based on screen size

Correct me if i'm wrong but my understanding is all .qrc files that were added to the qt program are loaded into ram when the app runs. Is it possible to load the .qrc files dynamically into ram? For example I have 3 image files one for 720p, one for 1080p, and one for 4k. What I have in my main.cpp is code to get the screen resolution and loads an image from the .qrc. I do not want to put the images onto the local filesystem because of speed and also it is accessible by anyone.
Is there another option to store images files as one file that is loaded into ram based on screen size?
documentation states
Dynamic Resource Loading
A resource can be left out of an application's binary and loaded when it is needed at run-time by using the registerResource() function. The resource file passed into registerResource() must be a binary resource as created by rcc.

RSL used in FLEX

How to use RSL(Runtime shared library) in flex ?
how can decrease loading time of swf using rsl?
please give answer
The SDK default setting of the project is RSL.
check here Goto Project->Properties choose the Library path from the tab where you can see the framework linkage.
The thing is It is one of the way to reduce the size of the application and the library files are downloaded and saved to cache file in browsers. so when you run the application again, the library files are taken from the browser cache.so the loading makes faster than the first time.It continues until the cache is cleared from the browser. for more information refer here.

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.

ActionScript Protect .swf/.swc Files From Decompilation?

it is possible to protect a .swf file from decompilation?
i've been reading about compiling class libraries in a .swc file for distribution without revealing the code - possibly selling it. however, there are .swf decompilers you can use to expose the code, and a .swc file is simply a .zip archive, so changing myswc.swc to myswc.zip will reveal the .swf files of the library.
just curious, mostly.
You can't. Don't believe those swf protector/encryptors. Both the content of a swf and a swc need to be readable by the AVM2 so it can't be compressed or encrypted or anything. Bottom line is that you can't really protect your as3 code from being reverse engineered.
I am flash game developer i use Flash Secure Optimizer from http://www.eramsoft.com

Resources