Accessibility
 
Home > Products > Flash > Support > Building Applications
Flash Icon Macromedia Flash Support Center - Building Applications
Creating components in Macromedia Flash MX

Components are Macromedia Flash MX movie clips with defined parameters that are set during document authoring. Parameters correspond to variables in the ActionScript attached to the movie clip, which control the behavior and appearance of the movie clip. In this tutorial you'll learn to create:

A button component with parameters for a customizable button label, label font, and label color
A custom icon for the component to appear in the Components panel when you add the component to the Macromedia Flash MX application
A plain text or XML description of the component that will appear in the Reference panel
A Live Preview movie that enables users to see the effects of different parameter settings while working in the Macromedia Flash MX authoring environment
A custom interface for the component, to make it easier for users to enter parameter values

For best results in completing this tutorial, you should be familiar with the Macromedia Flash MX UI components, including how to add a component to a movie and set its parameters. For more information, see Macromedia Flash MX Help > Using Flash > Using Components and Flash MX Help > Using Flash > Introduction to Components Tutorial. In addition, you should be familiar with variables in ActionScript, including variable names, values, and types. For more information on variables, see Macromedia Flash MX Help > Using Flash > Understanding the ActionScript Language.

Components provide prebuilt user interfaces and scripting for adding interactivity to Macromedia Flash MX movies. With components, you can add interactivity to a Macromedia Flash MX movie without needing to create the ActionScript that controls the interactivity. To use a component in a movie, you simply add an instance of the component symbol to the movie and select values for the component parameters.

Note: Components replace and extend the SmartClip movie clips introduced in earlier versions of Macromedia Flash. You can save components authored in Macromedia Flash MX in Macromedia Flash 5 format. However, some component features are not supported in Macromedia Flash 5. Information on features not supported in Macromedia Flash 5 appears in notes throughout this tutorial.

You can use components to create simple interactivity that affects only the current movie, such as buttons that navigate between frames in the movie. You can also use components to send data to an application server and receive data from a server—for example, in a web form that collects user input on a commerce site.

In this tutorial, you'll learn how to make a labeled button component.


This sample file requires the latest version of the Macromedia Flash Player.

Download it now.

We've provided a button for you to use in creating the labeled button component. The button pulsates in the Up and Over states.

Note: The button's pulsating behavior cannot be previewed in the Macromedia Flash MX authoring environment until you create a Live Preview movie for the component document file. To preview the pulsating behavior without a Live Preview movie, choose Control > Test Movie when the sample FLA file is open in Macromedia Flash MX.

Download the Windows creating_comps source files (28K)
Download the Macintosh creating_comps source files (28K)

When the file decompresses, a folder named creating_comps is created on your system.

If you have trouble downloading or decompressing the files, see TechNote 13686.

Workflow for creating components
Create the component movie clip
Add ActionScript to the component
Define the parameters
Create a custom icon
Add a description
Create a Live Preview movie
Set the path to the Live Preview movie
Create a custom interface for a component
Set the path to the custom interface movie
Use the component in Macromedia Flash documents
Create your own components


Mary Burger

Mary Burger is a Senior Technical Writer at Macromedia. She specializes in Macromedia Flash documentation.


2 July 2002

Flash, components, component parameters, tutorial

9907