Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Classes > About working with built-in classes > Excluding classes | |||
To reduce the size of a SWF file, you might want to exclude classes from compilation but still be able to access and use them for type checking. For example, you might want to do this if you are developing an application that uses multiple SWF files or shared libraries, especially those that access many of the same classes. Excluding classes helps you avoid duplicating classes in those files.
For more information on excluding classes, see the following topics:
To exclude classes from compilation:For example, if your FLA file is sellStocks.fla, the XML filename must be sellStocks_exclude.xml.
<excludeAssets>
<asset name="className1" />
<asset name="className2" />
</excludeAssets>
The values you specify for the name attributes in the <asset> tags are the names of classes you want to exclude from the SWF file. Add as many as you require for your application. 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>
For information on preloading classes, see Preloading class files.
|
|
|
|