between your web pages and your users. While we reviewed numerous behaviors that made up different types of functionality depending on what we were working with, there were three behaviors we didn't get a chance to cover because they dealt with a topic we hadn't reviewed up to that point. The three behaviors included the Set Text of Layer, Drag Layer, and Show-Hide Layer behaviors. Now that you've had the chance to review and work with layers, the many properties that are exposed by layers, and how to build a simple website using layers, let's add a twist by introducing how Dreamweaver makes it possible for you to work with behaviors and layers together to enhance the user experience. Using the Set Text of Layer Behavior In the previous chapter, we looked at the Set Text of Status Bar and the Set Text of Text Field behaviors, which allow you to dynamically set the text value for either the browser's status bar or a text field when you click a button on the page. The same functionality can be applied to layers using the Set Text of Layer behavior. To use this behavior, follow these instructions: 1. Create a new HTML page by choosing the New option from the File menu. When the New Document dialog appears, select the HTML option from the Basic Page category and click Create. 2. Insert a new Button form object by clicking the Button icon from the Forms category in the Insert bar. When the button has been added to the page, select it and change the Action to None in the Properties Inspector. This setting prevents the button from trying to submit or reset the non-existent form. 3. Change the Button's text Label to read Add Text to Layer. 4. Draw a new layer on the page by switching to the Layout category in the Insert bar, clicking the Draw Layer icon, and drawing the layer on the page, preferably below the Add Text to layer button. 5. Select the Button object and choose the Set Text of Layer option from the Set Text submenu in the Add (+) menu. The Set Text of Layer dialog appears. 6. Because we have only one layer on the page, the layer Layer1 is the only selectable option in the Layer drop-down menu. If we had other layers in the page, we'd be able to select them from this menu as well. Now type some text in the New HTML text box. I'll enter the text Hello World and click OK. 7. Make sure that the event associated with the Button is onClick. If it's not, use the menu that appears when you click to the right of the event in the Behaviors panel to change it so that it uses the onClick event. To test the result, save your work and preview the page in the browser. When you click the Add Text to Layer button, the text Hello World will appear just below the text box (in the layer). Using the Drag Layer Behavior Another interesting and feature-rich behavior is the Drag Layer behavior. You can use this behavior to create drag-and-drop functionality on your page. Maybe you're developing a children's web-based tutorial where feedback is given when the child drags an object onto or within the space of another object. If that's the case, this behavior is perfect. To use the Drag Layer behavior, follow these steps: 1. In this example, use the layer that already exists on the page. Drag a headshot image from the Images folder into the layer. I'll drag the head_adatheadminassistant.gif file into the layer. 2. Select the image and choose the Drag Layer behavior from the Add (+) menu in the Behaviors panel. The Drag Layer dialog appears. 3. While I'll certainly provide a detailed description of the options in this dialog, for now, simply click OK. 4. Make sure that the event associated with this behavior is onMouseDown. This event allows the user to drag the image contained in the layer while the user's mouse is down on the image.