Creating The Actionscript Class File - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Use other options in the Component Definition dialog box, if desired:
3.
Click the Plus (+) button to define parameters.
This is optional. The best practice is to use the metadata Inspectable tag in the component's
class file to specify parameters. When an ActionScript 2.0 class is not specified, define the
parameters for the component here.
Specify a custom UI.
This is a SWF file that plays in the Component inspector. You can embed it in the
component FLA file or browse to an external SWF.
Specify a live preview.
This is an external or embedded SWF file. You don't have to specify a live preview here; you
can add a bounding box to the component movie clip, and Flash creates a live preview for
you. See
"Creating a component movie clip" on page
Enter a description.
The Description field is deprecated in Flash MX 2004 because the Reference panel has been
removed. This field is provided for backward compatibility when you save FLA files in the
Flash MX format.
Choose an icon.
This option specifies a PNG file to use as an icon for the component. If you specify an
IconFile metadata tag in the ActionScript 2.0 class file (best practice), this field is ignored.
Select or deselect Parameters Are Locked in Instances.
When this option is unselected, users can add parameters to each component instance that
differ from the component's parameters. Generally, this setting should be selected. This
option provides backward compatibility with Flash MX.
Specify a tooltip that appears in the Components panel.

Creating the ActionScript class file

All component symbols are linked to an ActionScript 2.0 class file. (For information on linking,
see
"Creating a component movie clip" on page
To edit ActionScript class files, you can use Flash, any text editor, or any Integrated Development
Environment (IDE).
The external ActionScript class extends another class (whether the class is a version 2 component,
a version 2 base class, or the ActionScript MovieClip class). You should extend the class that
creates the functionality that is most similar to the component you want to create. You can inherit
from (extend) only one class. ActionScript 2.0 does not allow multiple inheritance.
Simple example of a component class file
The following is a simple example of a class file called MyComponent.as. If you were creating this
component, you would link this file to the component movie clip in Flash.
930
Chapter 7: Creating Components
927.
927.)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents