When Lines Intersect Lines

I l @ ve RuBoard

If you draw several lines on the same layer, they interact. Draw a new line across an existing one, and the new line cutsor, in Flash terminology, segments the old. Segmentation happens whether the lines are the same color or different colors, but it's easiest to see with contrasting colors.

To see how one line segments another:

  1. In the Toolbox, choose the pencil tool.

  2. In the Pencil Tool Property Inspector, do the following:

    • Set the stroke style to Solid.

    • Set the stroke height to 4 points.

    • Set the color to blue.

  3. On the Stage, draw a line.

  4. Click the stroke-color box (in the Toolbox or in the Property Inspector), and from the pop-up swatch set, choose a new color, such as red.

  5. On the Stage, draw a second line; make it intersect your first line at least once. Flash segments the line. To see the segments, select various parts of the line with the arrow tool (Figure 4.1).

    Figure 4.1. When you draw one line across another, every intersection creates a separate segment.

    graphics/04fig01.gif

The Mystery of the Stacking Order for Strokes

When drawing one line on top of another, you might expect that the last line drawn would wind up on top, but sometimes, that's not the case. In this exercise about intersecting lines, for example, if you start with a red line and then draw a blue line across it, you'll see that the blue line jumps behind the red one when you release the mouse button.

Flash creates a stacking order for lines based on the hex-color value of the line's stroke-color setting. The higher the hex value of the stroke color, the higher the line sits in a stack of lines drawn on the Stage. A line whose stroke color is set to a hex value of 663399 always winds up on top of a stroke whose color is set to 333399.

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