User Guide
Table Of Contents
- Contents
- Working with Flash MX 2004
- Creating Basic Components in Flash MX 2004
- Creating Advanced Components in Flash MX 2004
- Contents
- About Creating components
- Writing the component’s ActionScript code
- Simple example of a class file
- General process for writing a class file
- Selecting a parent class
- Identifying the class, symbol, and owner names
- About the component instantiation life cycle
- Writing the constructor
- Specifying clip parameters
- Implementing the constructObject2() method
- Implementing the init() method
- Implementing the createChildren() method
- Implementing the commitProperties() method
- Implementing the measure() method
- Implementing the layoutChildren() method
- Implementing the draw() method
- Defining getters and setters
- Component metadata
- Defining component parameters
- Handling events
- Using the Event metadata
- About invalidation
- Skinning custom controls
- Adding styles
- Making components accessible
- Improving component usability
- Best practices when designing a component
- Using the ModalText example
- Troubleshooting
- Index

10 Chapter 1: Working with Flash MX 2004
About the default classpath
The default local classpath is empty. The default global classpath consists of the following paths:
• . (the dot)
• $(LocalData)/Classes
The dot (.) indicates the current working directory. Flash searches the FLA file’s current directory
for the ActionScript classes it needs.
The $(LocalData)/Classes path indicates the per-user configuration directory. This directory
points to the following physical locations:
• On Windows 2000 or Windows XP, this directory is C:\Documents and Settings\username\
Local Settings\Application Data\ Macromedia\Flash MX 2004\en\Configuration\Classes.
• On the Macintosh, this directory is volume:Users:username:Library:Application Support:
Macromedia:Flash MX 2004:en:configuration:classes.
The user configuration directories mirror the directories located in Flash_root/en/Configuration.
However, the classpath does not directly include those directories.
By default, Flash MX 2004 does not include the Flex classes in its environment. You must
download and install a separate set of files, and then add them to your classpath settings. For
more information, see “Adding Flex classes and components to the Flash IDE” on page 8.
Changing the Flash classpath
This section describes how to change the global and local classpaths. Macromedia recommends
changing only the local classpath and adding the following entries to your local classpath:
• $(LocalData)/Flex Classes
• . (the dot)
The $(LocalData)/Flex Classes classpath entry points to the classes that you extracted in “Adding
Flex classes and components to the Flash IDE” on page 8. The dot (.) indicates the current
working directory in Flash. This is the directory in which you store your FLA file.
Note: To edit the local classpath, you must have a FLA file open.
To change the local classpath:
1.
Create a new FLA file or open an existing FLA file in Flash.
2.
Select File > Publish Settings.
The Publish Settings dialog box appears.
3.
Select the Flash tab.
4.
Click the Settings button.
The ActionScript Settings dialog box appears.
5.
Add, remove, or edit entries in the Classpath dialog box.
6.
Click OK to save your changes.
7.
Save the FLA file.