Section 3.2. Adding Layers to Your Animation


3.2. Adding Layers to Your Animation

Imagine you're creating a complex animation in Flash. You want to show a couple of characters carrying on a conversation, a car speeding by in the background, and some clouds floating across the sky.

Theoretically, you could draw all of these elements together, in one layer (one set of frames ). In the first frame, you could show the characters greeting each other, the car entering from stage left, and the first cloud drifting in from the right. In the second frame, the characters might begin speaking and waving their hands, the car might advance just a bit, more clouds might appear from the right, and so on.

Now imagine that your spec changes. It's not a car you need in the background, but a galloping dog. A relatively simple change, conceptuallybut because you've drawn all the graphic elements on a single set of frames, you now need to redraw every single frame . You need to slice away the car where it touches the other elements, and then you need to draw in the dog. And because the dog needs to appear behind the two chatting characters, you can't even take advantage of Flash's motion tweening (which you can learn how to do on Section 3.3), or even copying and pasting to speed up the animation process (Section 2.4).

Fortunately, Flash gives you an alternative: layers . Layers in Flash are virtual, clear plastic sheets that you stack on top of each other to create composite frames. So you can draw each element of your animation on a separate layer: the clouds, the car, the first character, and the second character. When you stack the layers together, your animation's complete.

Then, when you need to replace the car with a dog, all you need to do is delete the car layer and create a dog layer. You're working with a single object on your dog layer, so you can copy and paste and even create motion and shape tweens, all without affecting any other part of your animation. And if you decide you want the dog to gallop in front of your characters instead of behind, you can make that change simply by restacking ( reordering ) your layers with the dog layer on top.

3.2.1. Creating Layers

When you create a new document, Flash starts you out with one layer, called Layer 1, in the Layers area of the Timeline (Figure 3-8).

Figure 3-8. A layer is nothing more than a set of frames, which is why Flash displays layers to the left of the Timeline (that way, you can easily spot which frames belong to which layer). When you create a new document in Flash, Flash names your first set of frames Layer 1. At some point, replace it with a more meaningful name that describes the content of the layer. See the tip on Section 3.3.3.1.

To create an additional layer:

  1. On the Timeline, click the name of the layer you want to add a layer above .

    If you're starting out in a new Flash document, there's only one layer to select Layer 1.

  2. Still on the Timeline, right-click the layer namein this example, Layer 1 and then, from the pop-up menu that appears, select Insert Layer .

    Flash creates a new layer, named Layer 2, and places this new layer above the existing layer, as shown in Figure 3-9.


Note: Flash gives you two additional ways to create layers: by clicking the Insert Layer icon (Figure 3-9) and by selecting Insert Timeline Layer.




Flash 8
Flash Fox and Bono Bear (Chimps) (Chimps Series)
ISBN: 1901737438
EAN: 2147483647
Year: 2006
Pages: 126
Authors: Tessa Moore

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net