Working with Movie Clips > About multiple Timelines > Sending messages between Timelines
Sending messages between TimelinesYou can send messages from one Timeline to another. One Timeline contains the action, called the controller, and another receives the action, called the target. You can assign an action to a frame or button in a Timeline, or, if the Timeline is a movie clip, to the movie clip itself.
To target Timelines, you can use actions from the Actions category, or you can use methods of the MovieClip object from the Objects category in the Actions panel. For example, you can use the duplicateMovieClip
action to target and make copies of movie clip instances while a movie plays.
You can use actions from the Actions category to target a Timeline.
You can use methods of the MovieClip object to target a Timeline.
To perform multiple actions on the same target, you can use the with
action. Similar to the JavaScript with
statement, the ActionScript with
action is a wrapper that lets you address the targeted Timeline once, and then have a series of actions execute on that clip; you don't have to address the targeted Timeline in each action.
You can also use the tellTarget
action to perform multiple actions on the same target.
To communicate between Timelines, you must do the following:
![]() |
Enter an instance name for the target movie clip. |
To name a movie clip instance, use the Instance Panel (Window > Panels > Instance). Timelines loaded into levels use their level number as an instance name, for example, _level6 . |
|
![]() |
Enter the target path to the instance name in the Actions Panel. |
You can enter the target path manually, or you can use the Insert Target Path dialog box to target a movie clip. See Specifying target paths. |
Note: During playback, a movie clip's Timeline must be on the Stage to be targeted.