Accessibility
 
Home > Products > Flash > Support > Using ActionScript
Flash Icon Macromedia Flash Support Center - Using ActionScript
Working with multiple movie clips

This article discusses a movie that was built in Macromedia Flash 5 using nested movie clips and buttons and ActionScript commands, including the startDrag action.

Dragging any of the first four buttons in the movie also causes another part of the movie to be dragged, as indicated by the labels next to each button. Dragging the fifth button moves only that button.


To view this demo, you need the latest version of the Macromedia Flash Player.
Download the free Macromedia Flash Player now.

Get Macromedia Flash Player

The dragging behaviors were created by attaching ActionScript instructions (called scripts) to the movie clips and the buttons. For each Drag action, a script sends a message from the controller (the movie clip where the script is located) to the target (the movie clip that moves when the controller is dragged).

To see how the movie was put together, download the source file, open it in Flash, and work with the file as you read this article. You can also simply read the article without downloading the file, and work with your own file later.

Download the Windows source file nesting_movies.zip (8K)
Download the Macintosh source file nesting_movies.sea.hqx (12K)

To make best use of this article, you should be familiar with the Flash work environment, such as the Timeline, the library, symbols and instances, and the Movie Explorer. See Help > Using Flash for information on these topics. You should also have some basic familiarity with ActionScript and the Actions panel. For an introduction to basic ActionScript, see Getting started with ActionScript on the Flash Support Center.

About movie clips
About sending messages between Timelines
The hierarchical relationship of Timelines
Target paths
Creating the artwork
Defining the Drag behavior for the buttons
Defining the drag area for the draggable square instances
Controlling the target movie clips
Applying what you've learned


Mary Burger

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


9 July 2001

Flash, ActionScript, movie clips, target paths, nested movie clips

9816