|
Free Open Book
Teach Yourself Macromedia Flash 8 In 24 Hours |
Origami Paper Planes
|
Using Symbols from the LibrarySo far, the concept of dragging a symbol from the Library to create as many instances as you want has been pretty straightforward. It's powerful but easy to use. For a simple example, imagine that you made one symbol of a cloud. You could create many instances of the cloud symbol to make a cloudy sky. But you could do much more than that. Each instance on the Stage could be different from the next. One could be large and another one could be stretched out and darkened. In the upcoming task, for example, you'll see how multiple instances of one symbol can vary in size, scale, and rotation. And later this hour you'll make a symbol that contains instances of another symbol. Such nesting means not only that you can have many instances on the Stage but that you can recycle symbols to be used in the creation of other symbols. You'll learn about this one step at a time. Placing Instances of Symbols on the StageThis discussion might seem like repeated material, but the concept and process are very specific. One master symbol in the Library can be dragged on the Stage as many times as you like. Each one on the Stage is called an instance. You'll see how each instance can vary in a minute, but first let's review a couple points. If you copy and paste an instance that is already on the Stage, you are simply creating another instance. Not only is this okay, but it's sometimes preferable to the alternative—simply dragging an instance from the Library—because all the properties of the instance being copied will be in the new instance. Remember that the "copy" is just another instance. There's one other way to get an instance on the Stage (in addition to dragging it from the Library or copying one already on the Stage). Maybe you'll think I'm cheating, but as a review, consider that you can draw a plain old shape, select it, and use Convert to Symbol. This procedure puts the symbol in the Library but also leaves on the Stage an instance of the symbol. If this doesn't make sense, try repeating the task "Create a Symbol by Converting Selected Objects" from earlier in this hour. Modifying Instances of SymbolsBelieve it or not, by simply dragging two instances of the same symbol onto the Stage, you create two instances with different properties—because they vary in position. In other words, each instance is in a different location on the Stage. Each instance can be made different in other ways, too. For example, you can transform the scale of any instance on the Stage—without adding to the file size in any significant way. You can rotate each instance separately, as well. The following task explores how to vary the properties of separate instances in regard to their position, scale, and rotation. Try It Yourself: Transform the Location, Scale, and Rotation of Instances In this task you'll transform the properties of several instances. Here are the steps:
You might think that varying each instance's position, scale, and rotation provides for a lot of combinations—and it does. However, there's more. Each instance on the Stage can have a color style, a blend, plus a variety of filters applied to it. Next, we'll explore each one briefly and then, next hour, you'll see them applied in practical applications. Using Color StylesColor Styles include tinting the color of an instance, changing its brightness, and changing its alpha property (that is, its opacity). Similarly to how each instance can have a different location, each instance can have different color effects. To move an instance, though, you just pick it up and move it. To apply a style, you use the Properties panel. To change an instance's color style, you simply make sure the Properties panel is visible and select the instance on the Stage. While the instance is selected, you can specify any style you want by selecting from the Color drop-down list. Take a look at Figure 4.9 and the following list to familiarize yourself with these effects (then you can proceed to the task, which steps you through many of the subtleties of several effects):
Figure 4.9. The Properties panel provides several ways to change an instance.![]() Try It Yourself: Change Color Styles on Several Instances In this task you'll explore color styles. Here are the steps:
One way to describe color is by specifying the three factors: hue, saturation, and brightness. If you want to explore these factors, you can change the Color Mixer panel's option arrow from RGB (red, green, blue) to HSB (hue, saturation, brightness). Hue is the base color. Moving from left to right in the Flash Color Mixer panel, you see the hue change from red to yellow to green to blue and to red again (with every shade of color in between). Brightness is how much white is included in a color. Imagine a paint store with a bunch of hues of paint. The store could mix in white paint to create other colors. In the Flash Color Mixer panel, the brightness is shown vertically—at the top, the colors are all white and at the bottom, they're all black. Finally, saturation is the amount of color. For example, if you were staining a wood fence, the more stain you used, the more saturated the color would become. In Flash you vary the saturation by changing the Tint Amount slider. Using Blends and FiltersFlash Professional 8 adds the Blend option (under Color Styles in the Properties panel) as well as the concept of Filters (a separate panel). Both features fall into the "expressive" category because they give you greater image control. But they also fit well in this Library chapter because they both apply to instances. (Here you'll learn the technical details and then in Hours 5 and 13 you'll practice more practical uses.) Blends define how overlapping instances composite (or blend with) each other. You can think of the alpha color effect as a simple type of blend because it affects how much of the objects underneath will show through. Blends, however, are much fancier, performing such effects as Invert (which looks like photographic negatives) and Darken (which shows only the darker of two colors). Filters are like special effects filters found in imaging programs such as Adobe Photoshop—but here you apply the effects to any symbol instance. The Drop Shadow Filter, for example, is a powerful (and easy) way to make an instance appear to float off the screen. It's also interesting that filters are nondestructive, meaning they don't permanently change the symbol. This means you can apply different filters (and at varying degrees) on several instances of the same symbol—and always go back to adjust or remove the filter effect. (You can even animate filter effects, as you'll see in Part II.) In this chapter you'll see how Blends and Filters work and in the next chapter, you'll see practical ways they can be applied to your projects. BlendsApplying a Blend is nearly identical to applying a color effect. Just select an instance and select one of the Blend options from the Properties panel, as shown in Figure 4.13.
Figure 4.13. The Blend you select from the Properties panel affects how a symbol composites with what's underneath.![]() Notice the base is just as important as the overlay—sometimes more important. Also notice that this list doesn't give you practical uses for each option. One perfectly legitimate way to use blends is by just exploring. However, you will see several practical uses in the next chapter. Using FiltersYou can apply filters to any symbol instance onstage (plus text objects). First, open the Filters panel, select an object, and then select the filter you want to apply. Take a look at Figure 4.14. Figure 4.14. You can apply advanced special effects to symbol instances using the Filters panel.![]() To start, select an instance and then click the Add Filter button (the plus) to select a filter. The menu that appears also lets you remove, enable, or disable all filters already applied to the instance. You can individually remove filters by clicking the minus button (don't press Delete on your keyboard because you'll remove the symbol instance). You can also click the green check mark (for enabled) to temporarily disable individual filters. After you've added a filter, the properties for that filter appear on the right side of the panel. You can adjust the strength or blur of a filter, for example. The Filters panel supports adding multiple filters to get a layer effect . For example, you can use the Adjust Color filter (say, to desaturate a color image into black and white) and then also add the Drop Shadow filter. Because multiple filters are cumulative, the order in which they're applied makes a difference. For example, if you apply a Drop Shadow and then a colored Glow, the Glow is applied to the instance as well as its Drop Shadow (and you'll see color all around the shadow). If you put a colored Glow and then a Drop Shadow, the object and its Glow are given a Drop Shadow (and the color only surrounds the instance). Because the order matters, you can click and drag to reorganize the filter order listed in the Filters panel. (The filters listed on top are applied first.) After you've spent time setting all the properties the way you want for one or more filters, you can save the settings as a preset. Just click the Add Filter button (plus) and select Presets, Save As. The properties available for each filter vary, although there are some consistencies. For example, all except the Adjust Color Filter include an option for Quality. This affects how smooth or choppy the gradations appear. Interesting, Quality affects performance but has almost no impact on file size. You'll notice the visual impact of the Quality setting most when the blur is greatest. The good news about all the filters is that you'll see their visual effects immediately, so it's worth just exploring the various options. (The Blends tend to require a little more foresight because many blends don't have any impact under certain conditions.) Like blends, I'll just list the filters here and let you explore on your own. In the next hour, you'll get plenty of exercise applying them to real tasks:
As a summary of color styles, blends, and filters, consider the normal process you'll follow to create a graphic. Start by making symbols based on a foundation of building blocks—basically, the graphics you can import or draw in Flash. Place them on stage and then apply color styles or filters. Blends let you define how layered objects appear. When you want the same effect applied to multiple objects, you can nest symbols inside symbols, as discussed later in "Nesting Instances of Symbols Inside Symbols." Although in Hours 2 and 3 you learned lots of ways to either create or import graphics, the color styles, blends, and filters shown previously give you ways to create even more advanced effects. Plus, compared to importing raster graphics with the same visual effect, applying effects to instances in this manner is much more bandwidth friendly. You're already being efficient by storing graphics in the Library, but because all these effects are applied at runtime, they are almost always smaller than raster alternatives. Of course, they're also better because you can make edits right inside Flash. I should note that even though such runtime effects don't add much to file size, they do tend to reduce your movie's performance by making it play slower. Don't worry, though, because the impact is not an issue unless you overdo it—plus, you'll learn ways to optimize performance in Hour 21, "Optimizing a Flash Site." How Each Instance Behaves DifferentlyYou've already seen how each instance on the Stage can be uniquely positioned, scaled, rotated, and colored. There's one more way in which instances can be different from one another: They can behave differently. Remember the Behavior option for creating a symbol? You have to decide among Graphic, Button, and Movie Clip. So far, I've suggested just using Movie Clip, which is the default. Later, we'll look much more closely at the Button and Movie Clip options (see Hour 14, "Making Buttons for the User to Click," and Hour 12, "Animating Using Movie Clip and Graphic Symbols"). For now, we'll discuss how the Behavior option relates to instances on the Stage. When you create a symbol, you must select a behavior. Later on you'll learn about the differences between the behaviors, but for now they're not terribly important because you can change the behavior. From the Library window, you can change any symbol's behavior via Properties, which you access by clicking the little blue i button, by selecting the Library's options menu, or by right-clicking the item and selecting Properties. The Symbol Properties dialog box reappears; it's almost identical to the dialog box you use when you create a symbol in the first place as shown in Figure 4.15. Think of this setting as the default behavior. Any instance dragged out of the Library while the symbol is, say, set to Graphic starts out as a graphic. Changing the master symbol to another default behavior has no effect on instances already spawned, only new ones you drag onto the stage. Figure 4.15. The Symbol Properties dialog box lets you change the default behavior for a symbol.
Not only does a master symbol have a default behavior, but each instance onscreen also has its own behavior. You can use the Properties panel to see and change the behavior of any instance or instances already on the Stage. For example, you can use the Properties panel to see that the instances used in the last two tasks have the Movie Clip behavior. That's because the master symbol was a Movie Clip at the time the instance was placed on stage. You can change the behavior of any onscreen instance by simply selecting it and changing the Behavior drop-down list in the Properties panel. Later you'll be deliberate in your choice of behavior—just realize you can always change the symbol's default behavior or the behavior of any instance. Nesting Instances of Symbols Inside SymbolsYou can drag a symbol from the Library and create an instance anytime. You can even use instances of one symbol to create other symbols! This means you could draw a bunch of houses (as shown in Figure 4.16) with just one line. Sure, there's a House symbol, but that was drawn with several instances of another symbol, Box, and a few instances of a symbol called Line. Actually, the Box symbol was created with four instances of the Line symbol. This case shows an excessive use of hierarchy, but it proves a point: Instances of symbols can be used to create other symbols. In the next task you'll see how to perform such nesting. Try It Yourself: Make a Symbol by Using Instances of Another Symbol In this task you'll nest symbols inside each other. Here are the steps:
Figure 4.16. The house, duplicated and modified, was created with several instances of a Line symbol.
|
< Day Day Up >
|
|
|
Origami Paper AirPlane
|