Exporting Components - MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

You must create the class file before turning the symbol into a component. If Flash does not
convert your symbol into a component, it most likely cannot find the ActionScript class. Another
possibility is that the class file is not in the Flash classpath.
To convert a symbol into a component:
Create an ActionScript class file and save it with an .as filename extension.
1.
For more information on creating ActionScript class files, see the examples in
"Creating Basic Components in Flash MX 2004," on page
Save the FLA file that you are working in. If you do not save the document, Flash does not try
2.
to establish a link between the FLA file and the class file.
Right-click the custom component's symbol name in the Library.
3.
Select Component Definition.
4.
The Component Definition panel appears.
Enter the class name in the AS 2.0 Class text box. You must enter the fully qualified class name,
5.
if the class is in a package. Do not include the filename extension. For example, if the classname
is MyComponent.as, enter MyComponent.
Click OK.
6.
Flash transforms the symbol into a component and populates the Parameters box with the
component properties that are available in the class file and the classes from which your class
inherits, as the following figure shows:

Exporting components

Flash MX 2004 exports components as component packages (SWC files). A SWC file contains all
the code, SWF files, images, and metadata associated with the component, so you can easily add
it to your Flex environment. When you distribute a component, you only need to give your users
the SWC file.
SWC files are usually copied into a single directory for use in Flex or Flash, so each component
must have a unique filename to prevent conflicts.
This section describes a SWC file and explains how to import and export SWC files in Flash.
16
Chapter 1: Working with Flash MX 2004
Chapter 2,
23.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents