Creating Rollover Buttons in Fireworks
One of the most common tasks in any web development endeavor is to create a menu that features rollover buttons. In Chapter 3, "Building a Web Page," we used pre-built rollover images available from the Images, Image Objects, Rollover Image command. In Chapter 10, "Using Dreamweaver Behaviors," we looked at the Swap Image and Swap Image Restore behaviors as alternatives for incorporating rollover images in your web pages. What we didn't do however, is examine exactly how those rollover images were created. Using Fireworks, in conjunction with Dreamweaver, we'll do that now. To create a rollover image using Fireworks, follow these steps:
Open Fireworks. Create a new document by choosing File, New (or by pressing Ctrl+F4 in Windows or Command+F4 on a Mac). This launches the New Document dialog box. Specify a width of 150 pixels, a height of 25 pixels, a resolution of 72 pixels/inch (the default for web images), and click OK.
In the new document, choose the Rectangle Vector tool, a fill color, and a stroke color. Draw a box on the document.
With the rectangle selected, press F8 on your keyboard to bring up the Symbol Properties Inspector. In the Name text box, type a unique name for your new symbol and choose the Button Type similar to Figure 19.12.
Figure 19.12. Give your new symbol a name and change the Type option to Button.
Use the Text tool to add some text to your graphic. I'll add the text Click Me.
Select the Pointer tool from the toolbox and double-click the symbol to enter into Button Symbol Editing mode, similar to Figure 19.13.
Figure 19.13. Double-click the new symbol to enter into Button Symbol Editing mode.
Click the Over tab near the top of the workspace to edit the Over state of the button. Clicking the Copy Up Graphic button near the bottom-right corner of the workspace allows you to carry over any attributes, including the graphic as a whole, from the Up state.
After you click the Copy Up button, the Up state is copied to the Over state. Notice that all the tools are still available to you. Highlight the selection and choose a different fill color from the toolbox. This is the color the button will change to when the user hovers the mouse over the button.
Click the Down tab. In the Down state, click the Copy Over Graphic button. The Down state now has the same attributes as the Over state. Select the symbol and change the color once again. This is how the button will appear when the end user clicks the button.
Click the Active Area tab. This is the same concept as a hot spot in an imagemap. The active area defines what area activates the button. For best results, make sure that the active area covers the entire graphic. Click Done when you're finished making all changes.
Click the Preview tab at the top of the document to see how your button will behave in a browser.
In Fireworks, select the Export option from the File menu. The Export dialog opens.
Browse to the root folder in the defined site.
Give the new HTML file a name such as rollover.htm.
Select the HTML and Images option from the Save As Type menu.
Enable the Put Images in a Subfolder check box and browse to find the Images folder in the local root folder of the site you are working with in Dreamweaver.