attachMovie

Now we can get some ActionScript started. Make sure you are on the main stage, with the blank keyframe selected:

Bring up the Actions dialogue box. You can Right-Click on keyframe 1 and select Actions, or use the F9 keyboard shortcut.

We are going to "Attach" a copy of the bee MovieClip to the main stage using attachMovie. It takes a few steps, so let's ease into it:

  1. First, make certain the Actions box says Actions-Frame
  2. Turn on Script Assist if it is not on by default
  3. Click ActionScript 2.0 Classes > Movie > MovieClip > Methods > attachMovie

Now let's do some dirty work:

  1. Type _root in the Object box
  2. Type bee in the Linkage Name box and ensure Expression is not selected
  3. Type bee in the New Name box and esure Expression is not selected
  4. Type 1 in the Depth box

Go ahead and test your movie if you like. The bee should be sitting in the 0,0 (top left corner) position of the stage. We will set the x,y position later, but for now I think you need a little explanation about what's with attachMovie:

  1. The Object is _root, which refers to the main stage. This is important because it will come up again and again in ActionScript! Say it like this: underscore root. We are telling Flash to attach a movie to the main stage. It is possible to insert MovieClips inside other movieClips (Like when you put wheel movieClips inside a car movieClip) and we will get to that later.
  2. The Linkage Name is "bee", which of course refers to the name we assigned earlier using Linkage Properties. It is important to note that we turned Expression off, because we don't want Flash to think bee is a variable needs to be evaluated. When we tell Flash to attach "bee", we really mean "bee"!
  3. The New Name is "bee", which might be confusing because the Linkage Name is "bee" too. Remember, we can have multiple copies of the same MovieClip on the stage, but each should have it's own Instance Name. So that's what we are really doing here: Assigning a new Instance Name. Since I know we are only going to be working with this one bee, I just kept calling it "bee" (Instead of bee1 or bee2 or bee3). Again, notice that Expression is off because we don't want Flash trying to evaluate a variable: We really want the instance name to be "bee".
  4. Finally, we set the Depth to 1. Think of Depth in terms of Layers in the timeline. Whatever is on Depth 1 is going to be overlapped by objects on Layer 2, 3, 4 etc. The key word is "overlapped" because it is also possible for a movieClip to be completely "replaced" if you try to attach a new clip to the same depth! We don't need to worry about that for now because I know we are only working with this single bee.
OK, I hope you read through that explanation at least twice! If you don't fully understand it, don't worry too much because it took me a few times! This skill will keep coming up, and with some more practice, you will totally own it.