Using Layers
Another way to prevent overlapping shapes from segmenting is to draw them on separate layers. Layers work similarly in Flash as they do in programs like Adobe Photoshop and Illustrator. The Layers list is at the top left of the document window, at the left end of the Timeline:
Using Layers is important when animating, as most things need to be on their own layer to be animated.
Mask and Masked Layers
To create the image of the earth below, you need to mask a map of the world with a circle:
Mask layers determine the visible portion of the layer immediately beneath them (the "masked" layer). In the following diagram, the Earth layer is the bottom layer, and not masked at all. The black shape on the Mask layer makes only part of the Continents layer visible (the part directly beneath). Mask layers are invisible, so the black shape pictured below will only be seen in the authoring environment (NOTE: objects on mask layers don't have to be painted black; they can be any color since they are invisible to the viewer):
Fortunately, you do not have to draw the whole world, you can download the Adobe Illustrator file. NOTE: If your browser displays the postscript code instead of downloading the .ai file, right-click the link and select your browser's equivalent of "Download Linked File...". If your OS adds a ".ps" extension to the downloaded file, you must remove it before proceding!
- In a new Flash file, draw a blue sphere using what you learned about
radial gradients.
- Rename Layer 1 "Earth" by double-clicking the layer name.
- Choose FILE > Import > Import to Stage... and locate the WORLD.AI file you downloaded.
Click the Import button.
- A dialog appears when you import artwork from a vector-based program
like Adobe Illustrator, asking how you want to translate the layers
in the native file into Flash layers (Flash 9 import dialog pictured):
Ensure you have this import dialog set to translate Illustrator Layers into Flash Layers (pictured above) and click OK.
- Rename this resulting new layer "Continents."
- The map was drawn in black, and various land masses grouped into different
clusters. To color all the land green, click the Continents layer in
the Layer list (this selects everything on that layer).
- Choose MODIFY > Break Apart (you may have to do this twice. The
Break Apart command is supposed to eliminate all levels of grouping,
but really acts just like "Ungroup" in most cases).
- Set the Color panel's Fill option to green (this turns all selected
art green).
- Sometimes layers created by importing artwork appear at the bottom
of the Layer list, making the artwork appear behind everything else.
If your continents appear behind the blue sphere, drag the Continents
layer above the Earth layer in the Layer list.
- Group and scale the continents so they appear proportional to the
blue sphere (scale artwork by selecting it with the Free Transform tool
and SHIFT-dragging a corner).
- The blue sphere will not be the mask; it will be the oceans. However,
its shape is conveniently the exact size we need the mask to be, so
click the "Earth" layer to select the sphere, and choose EDIT
> Copy.
- Add a new layer by clicking the New Layer icon at the base of the Layers palette.
- Name the new layer "Map Mask."
- Ensure the new Map Mask layer is directy above the Continents layer.
- Choose EDIT > Paste in Place (this places the copy of the blue
sphere exactly where it was copied from, but on the active layer).
- Double-click the Map Mask layer icon (it's to the left of the layer
name), and select the "Mask" layer type from the list in the
dialog box.
- Double-click the Continents layer icon, and select the "Masked"
layer type from the list.
- Lock both the Map Mask and the Continents layers, by clicking the black dot under the padlock icon at the top of the Layer palette (both the mask and masked layers MUST be locked for the masking effect to display). [NOTE: A shortcut to perform these last 3 steps is to Control-click (PC users Right-click) the Map Mask icon, and select "Mask" from the contextual menu].
- Save your work.
More features
Flash has many features found in high-end drawing programs:
- a document grid for positioning elements (found in the VIEW menu)
- you can zoom in up to 2000% for precise work
- the Align panel can precisely space and align objects
- the Trace Bitmap command can turn imported photos into vector drawings (MODIFY > Trace Bitmap...)
- Flash has document rulers (VIEW > Rulers) and ruler guides (drag a ruler onto the stage to set a guide)
- Flash offers snapping (in the VIEW menu) in which you can snap objects to other objects and guides, or disable such snapping
- the Swatches panel stores custom colors (and even exports them for use in other documents)
- you can export an image in many file formats, including EPS, AI, AutoCAD, JPEG and GIF (under FILE > Export...).