Putting Gradients to Work

I l @ ve RuBoard

In "Creating New Gradients" earlier in this chapter, you learned how to create color blends. Flash treats gradients just like any other fill. You use the paint-bucket tool to fill outline shapes with a gradient and the brush tool to create freeform swashes of gradient color.

To fill a shape (or replace a solid fill) with a linear gradient:

  1. In the Toolbox, select the paint-bucket icon.

  2. In the Color Mixer panel, define a new linear gradient.

    or

    From the Color Swatches panel or from the fill-color box in the Toolbox or Property Inspector, choose an existing linear gradient.

  3. Click the paint bucket's hot spot (the tip of the drip of paint) somewhere inside the outline shape or within the existing fill (Figure 3.108).

    Figure 3.108. You can use the paint-bucket tool to apply a linear-gradient fill.

    graphics/03fig108.gif

    The shape fills with the linear gradient currently displayed in the fill-color boxes.

To fill a shape (or replace a solid fill) with a radial gradient:

  1. In the Toolbox, select the paint-bucket tool.

  2. In the Color Mixer panel, define a new radial gradient.

    or

    From the Color Swatches panel or from the fill-color box in the Toolbox or Property Inspector, choose an existing radial gradient.

  3. Click the paint bucket's hot spot (the tip of the drip of paint) somewhere inside the outline shape or within the existing fill (Figure 3.109).

    Figure 3.109. The paint-bucket tool can also apply a radial-gradient fill.

    graphics/03fig109.gif

    The shape fills with the radial gradient currently displayed in the fill-color boxes.

To paint with an unlocked gradient:

  1. In the Toolbox, select the brush tool.

  2. Make sure that the Lock Fill modifier is deselected (Figure 3.110).

    Figure 3.110. Deselect the Lock Fill modifier to paint with an unlocked gradient.

    graphics/03fig110.gif

  3. Using one of the methods described in the preceding exercises, choose a gradient.

  4. Paint with the brush as described in Chapter 2.

    Flash cannot preview the shape you paint with the gradient you chose, as it can do with solid-color fills. The preview shape has a black-and-white pattern.

  5. When you finish your brush stroke, release the mouse button.

    Flash redraws the painted shape, using the gradient currently selected in the fill-color box. Flash fills the shape's bounding box (an invisible rectangle that's just the right size to enclose the shape) with the gradient. The painted shape reveals portions of that gradient pattern ( Figures 3.111 and 3.112).

    Figure 3.111. A painted shape with a linear-gradient fill.

    graphics/03fig111.gif

    Figure 3.112. A painted shape with a radial-gradient fill.

    graphics/03fig112.gif

graphics/01icon02.gif Tip

  • You can also create a single underlying gradient for several shapes on the Stage by using the Lock Fill modifier. With the paint-bucket tool selected, choose a gradient fill. Then click the Lock Fill modifier. Flash creates an underlying hidden rectanglethe same size as the Stage filled with the locked gradient. Wherever you paint with the locked gradient by using the brush tool (or apply the locked fill to a shape by using the paint-bucket tool), Flash reveals that hidden gradient.


Gradients Add Overhead

Gradients are lovely, but they do increase file sizes and thereby slow the loading of published movies. Each area of gradient fill requires an extra 50 bytes of data that a solid fill doesn't need.

In addition, gradients take processsor power. If you use too many, you may see slower frame rates, or slower animations, in your finished movie.

I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

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