*** From the Archives ***

This article is from July 5, 2000, and is no longer current.

The Creative Toolbox: One Approach to Mastering Flash

3

As I look back at my ascent of Macromedia Flash’s learning curve, one milestone that stands out as a major achievement was when I fully understood the intricacies of Flash’s Tell Target command, which is used to manage and manipulate nested Movie Clips. I had known for some time that this command holds much of the power of Flash, but getting my head around how it is used required some time.

That was a couple of years ago, when Flash 3 was all the rage and Tell Target was about the extent of Flash’s interactive scripting capability. Since then Flash 4 has hit the scene with a full complement of scripting features including variables, if-then statements, and functions. These are great tools that push the sheer power of Flash, but they can be a bit daunting to someone trying to learn the program from scratch. This is why I still believe that learning the concepts behind the Tell Target command is vital and remains a great way to dive deeper into Flash, without drowning yourself in the limitless world of Actionscripting.

Understanding the Concept
Just as expert puppeteers have full command of each and every string on their puppets, true Flashers have total control of every Movie Clip in their movie. The Tell Target command affords this type of control. It allows you to control even deeply nested Movie Clips just as you would control your main movie. But since it lives as an Action, you can define it on a timeline or within a button.

To use the Tell Target command, you’ll need a Movie Clip (a movie set within your main movie) and an understanding of how to target that movie in a hierarchical manner. The latter part is the brain-taxing element of this whole process, so let’s break it down:

Anyone who has used a Windows-based system or published files for the Web has already seen this concept in action. Let’s say you have a file called "MyExample.doc" which is stored in a folder called "Work_Related," which in turn is located within another folder, named "Documents." To get to this file without a mouse, you would have to type in a string that described its location in a hierarchy. In the above example, that path would look something like this: "C:/Documents/Work_Related/MyExample.doc".

You address nested Movie Clips in Flash in pretty much the same way. Think of your main movie as your main directory or C: drive. Flash considers this "level0." Any Movie Clips placed at this level are considered one level deep, at "level1." A Movie Clip nested within a level1 Movie Clip is targeted as "level2."

One last point: To use these Movie Clips within movie clips, you need to provide each with a name. Go into the Instance Properties dialog and name your Movie Clips something logical (at least to you) under Instance Name. If everything is right in the world you should see the Movie Clip name(s) show up when you select Tell Target in the Action menu.

Let’s Try It
If you’re not completely comfortable with the concept of Tell Targeting yet, don’t worry — it takes a while to really catch on. Let’s go ahead and run through a little Tell Target exercise.

  1. Start a new file in Flash and open the Buttons Library (Libraries>Buttons). Drag out the VCR Right and VCR Pause buttons in the VCR Button Set to the Work Area. Also drag out the Animated Movie Clip from the Supporting Files folder.
  2. Select the Movie Clip and go into the Instance Properties, found in the Modify menu, and assign it a name like "Spinner."
  3. Now make sure you don’t have Enable Buttons selected under the Control menu. Select the VCR Pause button and bring up its Instance Properties (Command-I for Mac or Control-I for Windows). Go to the Actions tab and select "Tell Target" from the "+" pull-down menu. Flash automatically includes the "On (Release)" command for you as well as the "End On."
  4. "Begin Tell Target ("")" should be selected. Double-click the Movie Clip icon or name found to the right of the Action pane to target that clip. Notice that the action now includes the Movie Clip name in its string: Begin Tell Target ("/Spinner").
  5. You have now set up an action to target the Movie Clip named "Spinner" when the mouse has been released on the Pause button, but you haven’t defined what the action will do with the clip. While still selecting the "Begin Tell Target" action, go back to the "+" pull-down menu and select "Stop." This tells Flash to Stop the Movie Clip when the Pause button is pushed.
  6. Now repeat the last three steps, but choose the VCR Right button instead of the Pause button, and elect the "Play" command instead of "Stop."
  7. Select Test Movie in the Control menu and marvel at your handiwork.

If everything worked right you should have a simple example of Tell Targeting. The Pause button stops the spinning Movie Clip and the Play button starts it again.

Building a "Tripwire"
One of my favorite applications of the Tell Target command is something I call a tripwire. On your Timeline you can create an action that targets a Movie Clip to start playing at a specific time point. That Movie Clip could have another tripwire command set on its timeline that would command another Movie Clip to play, creating a domino effect of playing movies. This is a handy way to make sure a movie clip plays when it was intended to play, which is something you can’t always be sure of when you’re delivering your movie across the Internet.

Where Do We Go From Here?
This article is intended to help beginning Flash users go from basic to intermediate or advanced status. Not only does the Tell Target command open a world of possibilities, it gets you ready for what’s next — Actionscripting. But for now, spend as much time as you can learning what can be done with Tell Target. Nest Movie Clips within Movie Clips and design your own types of tripwires. Later on you can start throwing Variables and if-thens into the mix, building upon the foundation you have already laid by understanding Tell Target.

To build proficiency with Flash fast, also try dissecting other people’s Flash files. I’ve found this approach to be immensely helpful. There is a large community of developers out there willing to share ideas, insight, and Flash source code. Some of the best sites I have discovered in my quest for Flash knowledge are FlashKit, FlashMove, CNET FlashPoint, FlashZone, and ColinMoock.

Read more by George Penston.

  • anonymous says:

    This is a well written quicky tutorial on Flashs’ Tell Target Command. Very informative.

  • anonymous says:

    Great intro to the Tell Target and its function.

  • anonymous says:

    There are a lot of Flash tutorial sites out there, but this is the first article I’ve found that simply describes the Tell Target command and what it can do. This is a solid stepping stone that will help you reach those smaller, slippery ones.

  • >