Control MovieClips and Use Filters

Instance Names

Ok, let's get that nose on the stage. The keyboard shortcut to snap to the main stage is CTRL+E. Start by naming the layer nose, then drag the nose movieClip from the Library onto the stage:

Ok, my friends. This is the most important part of anything you'll ever do in your whole entire life. Actually, it's most important to me, because 90% of the problems people have with these projects are a related to instance names (or lack of them).

You are certainly familiar with Symbol Names.... in fact, you just put a copy of nose on the stage. If you think way back to the rolling car exercise, you'll remember that you can have multiple copies of the same movieClip on the stage. But how would you keep track of each individual clip if they are all named nose?

The answer is: As far as ActionScript is concerned, the clip you have on the stage is not called nose. In fact, it's just an instance of the movieClip nose, and it doesn't have a name at all! Each instance of a movieClip can (and should) have a unique name that you assign. Then, using ActionScript you can target each MovieClip using it's individual instance name. Once you can target a MovieClip, you can control it!

Let's assign the instance name mNose to the copy of the nose MovieClip you have on the stage:

  1. Use the Selection Tool (The black arrow) to select the MovieClip
  2. Find the <instance name> box in the Properties window and type mNose
  3. Press Enter on the keyboard

That's it! You should know that I totally made up the instance name mNose. You can make up whatever name you want, but you do have to follow a few rules:

  1. Do not begin an instance name with a number: 1mNose
  2. Do not include spaces in the instance name: m Nose
  3. Do not include hyphens in the instance name: m-Nose
  4. Do not use any ActionScript as names: play, stop, gotoandstop, color (just to name a few!)

To be on the safe side, avoid all symbols in instance names except for the underscore. Many programmers use the underscore to make legal instance names more legible: m_nose

The important thing is to keep the names legal, and develop a consistent naming convention. In my example, I assigned the instance name mNose because the symbol is a MovieClip (so I started with "m") and I capitalized Nose to make the instance name more legible.