Recipe 3.9. Hiding, Locking, and Customizing the Display of Layer Content


Problem

You need to customize the look or behavior of one or more layers, including hiding or locking the contents of a layer, displaying layer graphics as low-resolution outline graphics, and/or changing the height or width of the display of frames.

Solution

Toggle the visibility, editability, outline view on or off; use the Timeline Header Options menu or the Layer Properties dialog box to modify frame display.

Discussion

When editing Flash documents crowded with art, text, and other visual assets, it becomes increasingly difficult to select and work with only the elements you want. Accidental selections and deletions, as well as inadvertent placement of content in the wrong layer, become more likely as your movie grows. Flash offers a handful of tools that can be used to prevent this confusion.

Beside the stack of layer names are three controls available to each layer: layer visibility (Eye column), editability (Lock column), and outline display (Outline column). These elements control whether contents in that layer are editable and how they are displayed:


Eye column

Controls a layer's visibility in the authoring environment. When toggled off, all the contents of the layer are hidden. In addition, you cannot edit the contents of a hidden layer or add new content. Hidden contents are exported and visible in the SWF upon export.


Lock column

Locks or unlocks all the contents of a layer. When locked, the contents are still visible, but they cannot be edited and no new stage content can be added to the layer. Interestingly, you can add frame actions, labels, and comments to a locked layer. For this reason, many developers lock a movie's actions and labels layers in order to prevent inadvertent stage content additions to those layers. If the all-or-nothing nature of layer locking is too inflexible, you can lock one or more elements within a layer by selecting Modify Arrange Lock.


Outline column

Toggles layer content display between full view and a low-resolution outline view. The selected setting has no impact on the exported SWF. This setting is useful with complex vector illustrations, which tax the memory and undercut performance. It is also useful when positioning an element relative to other elements: you can lock the existing elements and toggle them into outline view, and then position the new element as desired. Each layer has its own outline color, which makes it easy to distinguish contents on different layers, even when all layers are in outline view.

To toggle any of these options on or off, click the dot in the appropriate column in the desired layer. You can also toggle any of these settings for all layers by clicking the Eye, Lock, or Outline icons themselves, above the layer stack. Finally, Alt-clicking (Windows) or Option-clicking (Macintosh) one of the dots toggles the column attribute of all the other layers. For example, if you want to edit the contents of one layer and lock the contents of all other layers, Alt-click or Option-click the Lock dot in the layer you want to edit.

You can also control the appearance and functionality of layers using the Layer Properties dialog box. You can access this dialog box by selecting a layer and choosing Modify Timeline Layer Properties. The options in this dialog box are mostly redundanthere you can rename the layer or toggle its visibility, editability, and outline display. You can also change the layer to one of the special layer types: guide, motion guide, or mask. The Outline Color option enables you to specify the color used for elements in a layer when Outline view is toggled on. The last setting, Layer Height, is discussed in the next recipe.

Keep in mind that any visibility, editability, or outline display changes you make to a layer as described in this recipe take effect during authoring time only. After you export the movie, those specific layer settings are disregarded. They are intended for the purpose of assisting you with managing layers during authoring time. If you want to make a layer invisible when the movie is exported, convert the layer to a guide layer as described in Recipe 3.11. The majority of layer content is not editable during playback of the movie, so there is little or no need to make such a change to the exported movie. There are certain elements that have the option of being editable, however. For example, input text fields, draggable movie clips, and buttons allow for various types of editability, so to speak. If you want to toggle the editable state of such elements, do so at the level of the element, not at the level of the layer. You can read more about how to manage the editability of those types of elements in the appropriate recipes in this book. Flash does not provide a built-in tool that will automatically convert all the contents of a layer to outlines in the exported movie. You will need to add an outline to each element manually. To do so, you can use the Ink Bottle tool as described in Recipe 1.22.

See Also

Recipe 3.10




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

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