You'll now convert button.png into a button symbol and then use the Button Editor to create a JavaScript rollover.
| 1 | Open the original button.png file, the one with just a single frame in it. |
| 2 | Use the Pointer Tool to select both the text and the background.
|
| 3 |
In Fireworks, buttons are a special type of symbols. To make one from the image we've previously created, choose Insert Menu > Convert to Symbol. This is similar to the New Symbol choice, but it may be used to create a symbol from previously constructed objects. (You could have created your button from scratch if you hadn't already made one.) Type Button in the Name text box and be sure to select the Button
option for the Type. |
| 4 |
The light green coloring of the image (below) indicates a slice object, which is necessary for rollovers; but you don't need to understand why at this point. The arrow on the selection indicates that the rectangle is an instance
of the button. The instance's original, the button symbol is stored
in the document's library. If you pull up the Library Panel, you'll
see it listed. |
| 5 |
Double-click the button to open the Button Editor (or choose Modify
Menu > Symbol > Edit Symbol). With the Button
Editor, you create the graphics you want for each state of the
button that JavaScript will use. This requires some explanation--as Fireworks
provides in the Instructions box at the bottom of this dialog.
Usually only the first two states are used. The other two are excessive, I'd say. The way a rollover works, then, is the over state is swapped for the up state when the mouse rolls onto the image. JavaScript is a small programming language that automates this swapping, but you need not know JavaScript as Fireworks will write it for you. To illustrate all of these button states, here's a little button that uses all four. Click it to see the down and over-while-down states; but you'll have to reload the page to see the up state again, if you do.
|
| 6 | Click the Over tab in the Button Editor and click the Copy Up
Graphic button--that is, copy the image that is used for the Up state.
(Confusing terminology, no?)
|
| Change this image to make it distinct from the Up state. You could change the background color, but I like to make the letters glow a bit. | |
| 7 |
Use the Pointer tool to select the text in the Button Editor's Over state.
Go to the Effect Panel and click on FDrop Down Menu (it may
say "Flat" or it may not) and then choose Shadow
and Glow and Glow (again). |
| 8 |
Compare the two "states" of the image you've just created (Up,
on the left; and Over, on the right). It also wouldn't hurt at this stage to go to the Modify Menu and choose Trim Canvas to reduce the button to just its active area, but this isn't essential. |
| 9 | You can now add the Internet address you will be linking to--if you know it. You can just make one up for this tutorial. |
| Click the Active Area tab in the Button Editor and then click Link Wizard in the lower right corner. | |
| Click the Link tab. Enter a URL in the text box at the top of the
dialog box. Use a valid URL (such as http://www.tcf.ua.edu) so that you
can test the button in a browser. |
|
| 10 | Click Okay and then close the Button Editor. |
| 11 |
Choose Export from the File Menu.
Now would be a good time to save your new, rollover-enabled file as buttonrollover.png. |
| 12 |
If you examine the HTML source of mar203.htm or your own HTML file, you'll find several comments hidden in it that explain how to insert this button into another document. There are two main sections:
This is the JavaScript that Fireworks has created for you.
|
| 13 |
Create a new Dreamweaver document and store it in the same folder as the JavaScript files. |
| 14 |
Position the cursor in the document, where you want the rollover button
to appear and then choose Insert Menu > Media > Fireworks HTML. |
| 15 |
Browse to the folder containing your Fireworks-generated HTML file. |
| 16 |
Create a new Dreamweaver document and store it in the same folder as the JavaScript files. |
| 17 |
Select it and Dreamweaver will insert the images and the JavaScript code just where you want it--as I've done right here! Check the source code of this page to see it in action. |
Follow me now to a Quick 'N' Dirty way to create a navigation bar with rollovers.
Bibliography