25 July 2010
Unless you specifically target symbols in the Library with linkage settings, instances of movie clip symbols in an Adobe Flash Professional document's Library cannot be programmatically accessed or created using ActionScript. When you publish a SWF file, any symbols in the Library that are never used on the Stage are not included—which is helpful because you don't need to comb through the Library and delete unused symbols and graphics to reduce the SWF's file size. Only the symbols that are used are exported.
However, this means that if you want to make a symbol available in the SWF for ActionScript to access at runtime, you must specify that the symbol should be exported for ActionScript.
Follow these steps to enable the Export for ActionScript setting:
By default, the Class field is populated with the symbol name (edited to remove any spaces). To specify that the symbol should use a custom class for its behavior, enter the full name of the class in this field, including its package. If you want to be able to create instances of the symbol in ActionScript, but don't need to add any behavior, you can leave the default class name that Flash assigns.
The Base Class field's value defaults to flash.display.MovieClip. If you want your symbol to extend the functionality of another customer class, you can specify that class's name instead—as long as that class extends either the Sprite or MovieClip class.
A warning is displayed if Flash cannot find an external ActionScript file with a definition for the specified class: "A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export." Disregard this warning if the symbol does not require unique functionality beyond the functionality inherited by the MovieClip class. Otherwise, enter the correct classpath that matches the ActionScript file (.as file) you are using.