Working with Movie Clips > Creating smart clips > Creating a custom interface
Creating a custom interface
A custom interface is a Flash movie that lets you enter values to be passed to the smart clip. The custom interface replaces the interface of the Clip Parameters panel.
The Clip Parameters panel with a custom interface movie.
The same smart clip without a custom interface in the Clip Parameters panel
Any values you enter using a custom interface are passed from the Clip Parameters panel to the smart clip through an intermediary, or exchange, movie clip in the custom interface. The exchange movie clip must have the instance name xch
. If a custom interface is selected in the Define Clip Parameters dialog box, the smart clip instance passes the defined parameters to the xch
movie clip and any new values entered in the custom interface are copied to xch
and passed back to the smart clip.
You must place the xch
clip on the main Timeline of the interface movie and xch
must always be loaded. The xch
movie clip should contain only the values to be passed to the Smart Clip. It should not contain any graphics, other movie clips, or ActionScript statements; xch
is merely a container through which values are passed. You can transfer top-level objects, such as Arrays and Objects, through the xch
clip. However, you should not pass nested Arrays or Objects.
To create a custom interface for a Smart Clip:
1 | Choose File > New to create a new Flash movie. |
2 | Choose Insert > New Symbol to create the exchange movie clip. |
3 | Create a new layer called "Exchange Clip". |
4 | With the "Exchange Clip" layer selected, drag the exchange movie clip from the Library window to the Stage in frame 1. |
5 | Select the exchange movie clip on the Stage, choose Window > Panels > Instance, and enter the name xch . |
6 | Create the interface elements that the author will interact with to set the clip parameters. For example, a pop-up menu, radio buttons, or drag-and-drop menu items. |
7 | Use the set variable action to copy variable and object values to the xch instance. |
For example, if a button is used as an interface element, the button could have an action that sets the value of the variable vertical and passes it to xch , as in the following: |
|
on (release){ _root.xch.vertical = true; } |
|
8 | Export the movie as a SWF file. |
![]() |
To use custom interface SWF with a Smart Clip, you need to link them in the Define Clip Parameters dialog box in the library that contains the Smart Clip. It's a good idea to save the SWF file in the same directory as the FLA containing the Smart Clip. If you reuse the Smart Clip in another file or pass the Smart Clip to another developer, the Smart Clip and the custom interface SWF must remain in the same relative locations.