Creating Components > Creating a custom interface for a component |  |

Creating a custom interface for a component

Creating a custom interface for your component is an optional step. A custom interface is a Flash MX movie that lets a user enter values for the component parameters. The custom interface replaces the interface of the component Property inspector. You use an Exchange movie clip to pass parameter values to the component.

The interface you create simply replicates the default interface displayed in the component Property inspector, which allows users to update the component parameters. However, you can create additional interface elements to make it easier for users to add parameter values. For example, the "Creating components in Macromedia Flash MX" tutorial on the Flash Support Center shows you how to add sliders for selecting RGB values.

The ActionScript code required to create a custom interface can become somewhat complex, depending on the number and type of parameters in your component and the type of interactivity you create.

Note: For more examples of components that use custom interfaces, see the samples described in Help > Samples > Feature highlight: Components, Live Preview, and Custom UI.

To create a custom interface for a component:

1 | Choose File > New to create a new Flash document.
2 | Create the interface elements that the user will interact with to enter parameter values—for example, a pop-up menu, a slider, radio buttons, or drag-and-drop menu items.
3 | Choose Insert > New Symbol to create an empty movie clip symbol and name it xch. Place an instance of the empty movie clip on the Stage in Frame 1 and name the instance xch.
4 | Add ActionScript code to the xch instance to capture the parameter values entered by the user and copy them to the xch instance.
5 | Choose Control > Test Movie to create the SWF movie for the custom interface. When the SWF movie appears in the Flash Player test window, close the window.
6 | Save the FLA file and close it.