DeviceCentral

TOPIC APPEARS IN:

Exclude classes from compilation for Flash Lite

To reduce the size of a SWF file, consider excluding classes from compilation but retaining the ability to access and use them for type checking. For example, try this if you are developing a file that uses multiple SWF files or shared libraries, especially those that access many of the same classes. Excluding classes helps avoid duplicating classes in those files.

  1. Create a new XML file.
  2. Name the XML file FLA_filename_exclude.xml, where FLA_filename is the name of the FLA file without the .fla extension. For example, if the FLA file is sellStocks.fla, the XML filename must be sellStocks_exclude.xml.
  3. Save the file in the same directory as the FLA file.
  4. Place the following tags in the XML file:
    excludeAssets>) 
    	<asset name=”className1” />) 
    	<asset name=”className2” />
    </excludeAssets>

    The values specified for the name attributes in the <asset> tags are the names of classes that should be excluded from the SWF file. Add as many as required for the file. For example, the following XML file excludes the mx.core.UIObject and mx.screens.Slide classes from the SWF file:

    <excludeAssets>) 
    	<asset name=”mx.core.UIObject” />) 
    	<asset name=”mx.screens.Slide” />
    </excludeAssets>