16/09/2010

Looking at reducing Flex movie sizes

I've recently finished a small Flex 3 movie which contains 3 datagrids, each showing financial prices. The movie then switches between different views, one for each datagrid.

Adobe Flex 3 ProfessionalImage by florianplag via Flickr
It was my first RobotLegs application, which in itself was a great learning experience, and has turned me into a RobotLegs fan boy.

After I created the movie I made a release build of the movie, and checked the file size, over 235K. A bit to large for our needs.

So I then made all the swc files Runtime Shared Libraries, this got the size down to about 155K, still quiet large. What I needed was some way to look into the produced SWF and see what was causing the large file size.

After some research I found a great question posted on the Stackoverflow site, where someone asked about Reducing SWF File Size in one of the answers for this post someone else mentioned a related question Why does my SWF file size not decrease when reducing context?. One of the great things about Stackoverflow is the related questions it suggests to you, one of the suggested answers for the Why does my SWF file size not decrease question is Any way to analyze the size of a SWF built in Flex?

In this post a replier mentioned a AIR app by Joe Berkovitz called ItDepends which anaylzes the size report of your Flex app, which can be created by adding the -link_report compiler options.

This ItDepends app reads through the generated link report XML file, and shows all the dependencies and a percentage of the whole file size the section makes up.

There is a better introduction to ItDepends on the Google code site.

So if you want to look into what makes up the size of your Flex app try ItDepends.

No comments: