Contents |
|
|
Creating Buttons in Fireworks |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Rollover buttons are a complex combination of animated graphic elements, text, and actions. Because of their complexity and their usefulness in Web design, Fireworks has a special Button Editor that helps make the creating of buttons easier. But since buttons are still complex objects, it helps to start with an understanding of how buttons work. |
|||||||||
Four Button States |
There are four states or appearances a rollover button can have. These are labelled with distinctive names in Fireworks:
|
||||||||
Graphic Objects and Text |
Each rollover button consists of a graphic image (often a rectangle, but any shape can be used) and text explaining what it does.
|
||||||||
Active Area |
In addition to displaying a button's graphic image on the Web page, the browser needs to be told what parts of the Web page the mouse pointer can be in to activate the button. This is called the active area. In Fireworks, the active area is shown as a green film over the underlying graphic. The active area doesn't necessarily correspond to the exact shape of the button, and you can adjust it with its "handled" like other Fireworks objects. Here are some characteristics of an active area:
|
||||||||
Slices |
Since each rollover button has several images associated with it, Web pages that display rollovers need to be separated from parts of the page that don't change, and from other rollovers. This is done by slicing the page or image. Each slice actually becomes a separate graphic file when the image is exported (saved for the Web). Fireworks shows the boundaries of the separate file with red lines. To turn of the red lines showing slices, and the green film showing active areas, click the button at the bottom of the Tool Palette. Click it again to see slices and active areas again. |
||||||||
Buttons on the Web |
|||||
|---|---|---|---|---|---|
Graphic Elements |
The graphic elements of a rollover button are images (rather than text) on a Web page.
|
||||
Swapping Images |
Because rollover buttons are a form of animation, there must be a change of images when a different appearance is needed (an "over" image, a "down" image, etc.). This is called "image swapping". |
||||
JavaScript |
HTML by itself cannot detect the location of the mouse pointer, and cannot swap images. Within the Web page, there needs to be some other way to get the browser to act appropriately. JavaScript is a programming language that can do what is needed, and since all browsers for the past several years have understood JavaScript (also known as ECMAscript), JavaScript is most often used. Here's what JavaScript does in rollover buttons:
In case you wondered...
|
||||
Translating Fireworks to the Web |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
Objects Become Bitmaps |
When any image, including a button, is stored for the Web, it has to be either a GIF or a JPEG. These are both bitmap formats, so when Fireworks exports a button, it creates a GIF or JPEG version. You can determine which of these two to use in the Optimize tab before exporting your button. |
|||||||||
Layers are Flattened |
Always save your Fireworks PNG files! You'll need them to make changes to your graphics, since the exported versions are difficult or impossible to edit. Your PNG files should not be put on the Web server - they're too big and bulky, and they can't be viewed by browsers. So it's smart to save them in a different directory than the one you use for files that go on the Web. |
|||||||||
Slices become Files |
Each row and column is numbered, somewhat like the rows and columns of a spreadsheet. Each part of the picture is identified by its row and column position. When you export your file, Fireworks saves each sliced part into a separate file, named automatically by taking the original file name (button.png in this example) and adding the row and column numbers separated by underscores. Of course, these files must be either GIF or JPEG - in this example, they are GIFs. Each of the four rollover states - Up, Over, Down, and Over While Down - has its own file too. These are handled by Fireworks like frames in an animation. Each state is a different frame. You can see these if you look in the Frames tab in Fireworks. The exported image file for each frame is named by adding its frame number after the row and column number of the cell where it is to appear. |
|||||||||
Files are put into HTML Tables |
|
|||||||||
Active Areas are Interpreted by JavaScript |
|
|||||||||
About this document... |
|
|---|---|
Audience: |
This is for people who have some experience creating graphics for Web pages. It is suggested that module D32i be completed. No knowledge of HTML or JavaScript is required, though it is expected that readers know what HTML is. |
Objectives: |
When you successfully complete this lesson, you will be able to...
|
Module D33c: |
This document is part of a modular instruction series in Computer Information Systems. For more information, see the overview or the list of modules in this series, D: Desktop Publishing and Computer Graphics. This document has been used in the following classes: INP 152. |
Author: |
Laurence J. Krieg |
Institution: |
|
| History: | Original:
June, 2002 Last modification: Monday, 31-Aug-2009 11:47:56 EDT |
|
Copyright: |
Copyright
© 2002, Laurence J. Krieg, Washtenaw Community College Instructors: You may point to this file in your Web-based materials. Students: you may make a copy for your personal use. All other uses: contact the author, Laurence J. Krieg for permission. Email krieg@ieee.org |