User Guide
915
CHAPTER 7
Creating Components
This chapter describes how to create your own component and package it for deployment.
The version 2 architecture has simplified the component development process in several ways. For
more information, see “What’s new in version 2 components” on page 916.
This chapter contains the following sections:
Component source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
What’s new in version 2 components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
Overview of component structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
Building your first component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 918
Selecting a parent class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 924
Creating a component movie clip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927
Creating the ActionScript class file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930
Exporting and distributing a component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
Adding the finishing touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 955
Component source files
The source files for the version 2 components that install with Macromedia Flash MX 2004 and
Macromedia Flash MX Professional 2004 are also installed with Flash. It is helpful to open a few
of these files, look through them, and try to understand their structure before you build your own
components. All the components are symbols in the library of StandardComponents.fla. Each
symbol is linked to an ActionScript class, as follows:
• FLA file source code: First Run/ComponentFLA/StandardComponents.fla
• ActionScript class files: First Run/Classes/mx