Avg. Rating 5.0

Problem

I need to really understand which classes are contributing how much to the overall output SWF size.

Solution

Use mxmlc's link-report feature along with a visualization tool such as the LinkReportAIR application to exactly know the size taken up each class and its dependencies.

Detailed explanation

The Flex compiler mxmlc has an option "-link-report" which can generate a report of linker dependencies and how much each class is contributing to the overall size of the application. 

Usage of the link-report argument:

mxmlc -link-report linkreport.xml (other arguments here)

On compilation, the link report  will be written to a file called linkreport.xml (or whatever name you choose). This is an XML file whose format is described in the Reducing SWF size livedocs page.

There are tools that help you visualize this XML file better such as the XSL file that you can include in your ant build file or the AIR application LinkReportAIR. Identifying the size taken up by each class and its dependencies helps a lot while trying to reduce your application size to the bare minimum.

Report abuse

Related recipes