Monday, March 9, 2009
i was posting the post after a long gap due to my busy schedule but i am back and updating post now daily
in this post we discuss how to reduce the build swf size .
there are some good tricks some of them are
1. if you application not have much dependency than split your application in Modules. where you can load and unload module according to your need.In module applications you just have to build a module and use that module swf for your application by providing the module swf url.
like ModuleLoader id='Module1' url='MyModule.swf' so don't think it's take your time.
2. Beside this if your application size increasing again again then you can use the Concept of runtime RSL into your Project, by using this feature you can split your project swf from the flex Framework.swf. where you flex FrameWork takes near about 200 to 400 kb. so by using this feature you can directly remove this 200 to 400 kb from your application swf.
For more study about this topic fo to your flex 3 help contenent and go in the Advanced flex Programming features. your can find step by step process to use RSL Concept in your Project.
But there is one darwback for the first time load it's take some time but after the FrameWork.swf is loaded in Client System then it does not take time to load your flex Application.
3. third very simple if your application size increasing due to the large image Embedation into the Project. then you can use the Concept of runtime css loading. In flex 3 this is very cool feature where you can embed large about images in your flex application without loading them with your flex application. steps to create the runtime swfs are as follows.
1. make a css file in your flex project.
2.embed all images that you like .
3.right click your css file and Choose the load as swf Options . this Option on project build will genrate a swf file of your css file.
4.no you can laod this swf on the Flex intialitions method call
like this
StyleManager.loadStyleDeclarations("../assets/MyStyles.swf");
this simply laod your css swf . even you can put multiple swfs in your Poject
and laod them when you need them.
For flex or flash builder
http://askmeflash.com/article/9/optimize-flex-swf-file-size-performance-loading-flash-builder
for flash cs
http://askmeflash.com/article/14/steps-to-optimise-swf-file-size-reduce-swf-size-how-to