How to use the Tell Target action
Timelines
Every Flash movie has a main timeline. With movie clips and the ability to load movies into a Flash Player*, multiple timelines can exist at once. Multiple timelines run independently and the structure is similar to a directory structure. The main movie timeline is similar to the root directory. Movie clips are similar to subdirectories of the main timeline.
The following is an example of multiple timelines.
MovieX.swf is the main movie and is on level 0 in the player. It contains two movie clips MCa with an Instance name of Jack and MCb with and Instance name of Jill. Within MCa there are also two movie clips MCm with and Instance name of Bert and MCn with an Instance name of Ernie. Also, there is another movie, MovieY.swf, loaded into the player (with a Load Movie action) on level 3. In MovieY.swf there is a movie clip MCt with an Instance name of Smith.
Basically the outline structure within the player is as follows:
- MovieX.swf (in level 0)
- MCa (Instance name: Jack)
- MCm (Instance name: Bert)
- MCn (Instance name: Ernie)
- MCb (Instance name: Jill)
- MCa (Instance name: Jack)
- MovieY.swf (in level 3)
- MCt (Instance name: Smith)
This means that there are 7 timelines in the player at once. Any timeline can control any other timeline. This is done using the Tell Target action.
When to use Tell Target
The Tell Target action is used to send an action from one timeline to another.
Using the sample above, here are some examples of when a Tell Target action would be used:
- If you have a button in MovieX and you want it to Stop movie clip MCa.
- If you want movie clip MCn to Play as soon as movie clip MCm has reached its last frame.
- If you want to Goto and Stop at frame labeled 'zephyr' of MovieX when a button in movie clip MCb is pressed.
- If you want movie clip MCa to Goto and Play at a frame labeled 'reset' when MovieY has reached its last frame.
- If you want a button in movie clip MCt to have MovieX Play.
These actions are all possible.
Note: A timeline must currently be in the Flash Player in order to be targeted. A timeline of a movie clip is present in the Player when the playback head is positioned in the frame that the movie clip exists. For example: if there is a movie clip placed on the timeline in frames 1 - 20, it can be targeted while the movie is playing or stopped at any frame between 1 and 20. Once the movie reaches frame 21 the movie clip is no longer in the Player and cannot be targeted.
How to use Tell Target
There is one field to fill in for the Tell Target action - the Target: field. The target is the timeline that is to be controlled. Any actions nested within the Begin Tell Target and End Tell Target actions will be directed at the targeted timeline.
In some situations, you will be able to see movie clips that are accessible in the window above the Target field. If this is the case and one of these movie clips is to be targeted, you may simply double-click it in the window. The correct information will automatically be entered in the Target field. At other times, the timeline that you wish to target will not be in the window and the path will need to be entered manually.
Main Timelines
The target for the main timeline can most easily be specified as a forward slash character: /
This can be used from any place in the current movie to control the current movie's main timeline.
The main timeline can also be controlled by using the ../ structure to move back up levels. Using this syntax to controlMovieX's main timeline from movie clipMCa or MCb, the Target is../
Similarly, to control MovieX's maintimeline from movie clip MCm or MCn, the Target is../../
To address the main timeline for a loaded movie use the following syntax:
_levelN/, where N represents the number of the level that the movie is loaded on
To control MovieX's main timeline from any other timeline with this syntax, the Target is
_level0/
To control MovieY's main timeline from any other timeline with this syntax, the Target is
_level3/
Movie Clips
Instance names are used to target movie clip instances in nearly every situation. The distinction between a movie clip and an Instance of a movie clip is important. A movie clip is a Symbol in the movie's Library. An Instance of the movie clip is the placement of the movie clip on the work area. There can be more than one instance of a movie clip. Each Instance name for that movie clip needs to be unique.
From the main timeline, to control a movie clip use the movie clip's instance name in the Target field. To control movie clipMCt (Instance name: Smith) from the main timeline of MovieY, the target isSmith. The Target can also be /Smith or_level3/Smith.
To control movie clip MCm (Instance name: Bert) from MovieX, the Target is Jack/Bert or /Jack/Bert or _level0/Jack/Bert
To control movie clip MCm (Instance name: Bert) from movie clip MCa, the Target is Bert or/Jack/Bert or _level0/Jack/Bert
To control movie clip MCm (Instance name: Bert) from movie clip MCn, the Target is ../Bert or/Jack/Bert or _level0/Jack/Bert
To control movie clip MCm (Instance name: Bert) from MovieY or movie clipMCt, the Target is _level0/Jack/Bert
The only situation when an Instance name is not required to control a movie clip is when a nested clip is controlling a movie clip above it. For example, movie clip MCm or MCn can control movie clip MCa with a Target of ../
* Flash Player
The Flash Player is used to refer to any of the following: Stand Alone Player, projector, ActiveX Control, plug-in or Java Edition Player on either Windows or Macintosh platform.
Note: The Java Player has not yet been revised to support anything beyond the Flash 2 format, and so these new Flash 3 features (movie clips and the Load Movie action) are not yet supported in the Java Player.
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
