Working with Grouped Elements


Grouping is a useful way to prevent shapes from interacting and to preserve spatial relationships among shapes as you work with elements on the Stage. Although you can also group drawing-objects, for the tasks in this section, you want to see the interaction with merge-shapes; make sure the Object Drawing button in the Options section of the Tools panel is deselected.

To prevent interaction between merge-shapes on one layer

1.

In the Tools panel, choose the oval tool in Merge Drawing mode.

2.

Set the stroke color to No Color and the fill color to red.

3.

On the Stage, draw a fairly large oval (Figure 5.9).

Figure 5.9. The oval before grouping.


4.

In the Tools panel, switch to the selection tool, and select the oval you just drew.

5.

To make the oval a grouped element, Choose Modify > Group (Figure 5.10).

Figure 5.10. The oval after grouping.


6.

Back in the Tools panel, choose the oval tool and a different fill color.

7.

On the Stage, draw a smaller oval in the middle of your first oval (Figure 5.11).

Figure 5.11. Draw a second oval on top of the grouped oval.


When you finish drawing the new oval, it immediately disappears behind the grouped oval (Figure 5.12). That's because grouped objects always stack on top of ungrouped objects (see the sidebar "Understanding Stacking Order," later in this chapter).

Figure 5.12. The ungrouped oval stacks beneath the grouped oval.


8.

Switch to the selection tool, and reposition the large oval so that you can see the small one (Figure 5.13).

Figure 5.13. Drag the grouped oval to make the ungrouped oval visible.


9.

Deselect the large oval, and select the small oval (Figure 5.14).

Figure 5.14. Select the small oval.


10.

To make the small oval a grouped element, Choose Modify > Group.

Flash puts the small oval in a bounding box and brings it to the top of the stack (Figure 5.15). Flash always places the most recently created group on the top of the stack. Now you can reposition the two ovals however you like, and they won't interact.

Figure 5.15. After grouping, the small ovalthe most recently created grouppops to the top of the stack.


Tips

  • In terms of stacking order, drawing-objects work much like groups. Try the task above with the following changes: in step 1 set the oval tool to Object Drawing mode; skip step 5; and in step 6, set the oval tool to Merge Drawing mode. The small oval disappears behind the larger one. You don't need to group a drawing-object to keep it separate from a merge-shape.

  • You can group several shapes so that you can manipulate them as a unit but keep them in the same relationship to one another. You might, for example, make the eyes and eyebrows in a face a single group. That would let you create new facial expressions by repositioning the eye elements or changing their size.

  • You can group grouped objects. To position several merge-shapes on top of one another, group them as individuals first. Position them as you like. Then group all the items to preserve their relationship.

  • You can lock groups so that you don't accidentally move or modify them. Select the group that you want to lock. Then, choose Modify > Arrange > Lock, or press Opt--L (Mac) or Ctrl-Alt-L (Windows). You can no longer select the item. To make it available again, choose Modify > Arrange > Unlock All, or press Opt-Shift--L (Mac) or Ctrl-Alt-Shift-L (Windows). You can't unlock locked items selectively.





Macromedia Flash 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Flash 8 for Windows & Macintosh
ISBN: 0321349636
EAN: 2147483647
Year: 2005
Pages: 204

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