Week 6: Website Navigation
Student Showcase
Turn in your Rotoscope and Midterm Projects at the beginning of class. We will take a look at everyone's work on the big screen.
Exercise: Build a Basic Flash Website
Let's build a five-page Flash website using materials found at Wikipedia about the wild Pallas's cat. Begin by downloading the ZIP file linked below. Then follow the step-by-step instructions in Flash.
Download
Getting the Timeline Set Up
- Create a new Flash [ActionScript 3.0] file and set the stage to 960px by 600px with a white background. Save the file as pallas-cat.fla.
- Add 8 new layers to the Timeline, and then name your layers as shown below:

- Create keyframes (F6) on the Actions layer at frames 10, 20, 30, 40, 50, and 60. This is where we will label our frames as well as put our ActionScript.
- Insert a frame (F5) on frome 60 of the Buttons and Background layers. This will assure that the menu and background are continuous throughout all website pages.

- Click in frame 1 of the Actions layer. In the Properties panel, give the frame the label of home. Give frames 10, 20, 30, 40, and 50 labels too, according to the table below. These labels give the ActionScript a destination frame to go to when a button is clicked:
| Frame | Label |
|---|---|
| 1 | home |
| 10 | characteristics |
| 20 | habitat |
| 30 | behavior |
| 40 | reproduction |
| 50 | conservation |

- Insert a frame (F5) at frame 9 on the Home layer. This will signify the end of the Home page content.
- Insert a keyframe (F6) at each of the following frames. These signify the beginning of each page's content:
| Layer | Frame |
|---|---|
| Characteristics | 10 |
| Habitat | 20 |
| Behavior | 30 |
| Reproduction | 40 |
| Conservation | 50 |

- Insert a frame (F5) at each of the following frames. These signify the end of each page's content:
| Layer | Frame |
|---|---|
| Characteristics | 19 |
| Habitat | 29 |
| Behavior | 39 |
| Reproduction | 49 |
| Conservation | 60 |

- Insert a keyframe in frame 9 of the Actions layer. Open the Actions panel (Window > Actions.) Place a stop command there. This will give you ten frames in which to display an animation on the home page (of course, you can always extend the length of time if you want, by inserting frames between frames 1 and 9; you can also elect not to have an animation):
stop();

- Repeat the stop command in keyframes at frames 19, 29, 39, 49 and 60 of the Actions layer. Your site is now set up so that if a button triggers a jump to a given page's content, the Playhead will only travel from the web page's first keyframe to its second keyframe and then stop without progressing to another page.

- Save the file.
Prepare the Images in Photoshop
The images provided to you in the ZIP file are very large. This is what you always want to start out with so that you can generate the highest quality downsamples possible. But they do need to be downsampled (resized to be smaller). The images will never need to be seen larger than the size of the website. If you work with the huge image files in your library, your resulting SWF will be an unpleasantly large file to download and view online.
- Open up each of the photos in Photoshop (the two non-photo images are already small enough for the site.)
- Use File > Save for Web and Devices to save a copy of pallas-cat_close-up_edinburgh-zoo.jpg in high-quality JPG format at 400px x 267px. Add the word small to the new file name.
- Save a small JPG copy of pallas-cat_looking-off-left_rotterdam-zoo.jpg at 400x400.
- Save a small JPG copy of pallas-cat_female_looking-off-right.jpg at 268x400.
- Save a small JPG copy of pallas-cat_rock-cave_zurich-zoo.jpg at 300x400.
- The background image of grass in snow (grass-in-snow.jpg) needs an opacity change.
- In the Layers panel, locate the lock icon on the left edge of the Background layer.
- Drag the lock icon to the trash icon at the bottom of the Layers panel. This converts the layer to a more editable one.
- At the top-right of the Layers panel, set the Opacity for this layer to 20%.
- Save a small JPG copy of grass-in-snow.jpg at 960x720.
- Close all the original image files without saving.

Create the Website Background
Our site background will contain site identification and a simple image.
- In Flash, choose View > Pasteboard so that we can see the whole stage in our window.
- Choose View > Rulers and pull a horizontal guide down from the top ruler. Line it up with the bottom of the stage.
- Select the Background layer in the Timeline panel.
- Import grass-in-snow_small.jpg to to stage.
- Use the Selection tool to position the image so that its top edge aligns with the top of the stage and its sides match the stage's sides. The bottom of the image extends past the stage, which is why it's nice to have a guide there.

- Pull another guide down so that it is 100px down from the top, and another at 130px. The top section will be for our site ID, and the second section for our buttons.
- Select the Text tool. In the Properties panel, choose TLF Text and Read Only.
- Choose an elegant font at about 60pt and make it black. Make sure it is set to align left.
- Click near the top-left edge of the stage and type Pallas's Cat.
- Press Enter/Return and reduce the font size to about 30pt. Type The cat that time forgot.
- Position the site ID so that it has a little room around it above the first guide.

- Select the Rectangle tool. Turn on Object Drawing and Snap to Objects. Set the fill color to white and the stroke to none.

- Draw a rectangle between the top two guides and from the left to right edges of the stage. This will form the backdrop for your menu buttons on the layer above.
- Lock the Background layer and save the file.

Create the Master Button
First we'll design a basic button with animation, and then we'll make copies for the six menu items we'll need.
- Insert > New Symbol
- For Name, type in Master. For Type, choose Button. Click OK.
- In the Library panel, create a new folder using the New Folder icon at the bottom of the panel.
- Name the new folder Buttons and drag your Master button into this folder.
- In the Timeline, name the current layer Background.
- Insert a frame (F5) in the Hit frame for this layer.
- Select the Rectangle tool and use these settings:
- Stroke: none
- Fill: a dark color
- Object Drawing: on
- Rectangle Options (bottom of Properties panel): all four corners at 15.00.
- Draw a rectangle on the stage which is 25px tall and 150px wide. You may want to use guides to get this exact.

- Add a new layer and name it Gradient.
- Select and copy the shape on the stage. Lock the Background layer.
- Go back to the Gradient layer and Edit > Paste in Place.
- Zoom way in so you can see what you are doing.
- Use the Free Transform tool to make the shape on the Gradient layer a bit small than on the Background layer, by a couple of pixels on each side.

- In the Properties panel, set the Stroke color to white (1px width.) Set the Fill color to the default linear gradient (white to black.)

- Switch to the Gradient Transform tool. Rotate the gradient 90° CCW so that the black is on the top. Resize the gradient so that it is only as tall as the shape.

- In the Color panel, make sure Fill (the paint bucket icon) is selected. Set the left crayon to the same color you used for the button background. Set the right crayon to a bit lighter shade of the same hue.

- In the Gradient layer in the Timeline, insert a keyframe (F6) in the Over frame.
- Insert another keyframe in the Down frame.

- Return to the Over frame, and select the gradient shape with the Selection tool.
- Convert it to movieclip symbol (F8) named Hover-effect.
- In the Library panel, drag the Hover-effect symbol into the Buttons folder. Double-click on its movieclip icon to open the symbol for editing.
- In the Hover-effect symbol, select the shape on the stage and press Ctrl+B (Mac: Cmd+B) twice to convert it back to a vector shape.
- Add a keyframe (F6) in frame 10 of the single layer.
- At frame 10, use the Gradient Transform tool to flip the gradient 180°.

- Right-click in between frames 1 and 10, and select Create Shape Tween.
- Test the animation by dragging the playhead.
- In frame 10, place a stop command in the Actions panel, as shown earlier. This will keep the animation from looping when the mouse hovers over a button.

- Return to editing the Master button.
- Move the playhead to the Down frame and select the gradient shape with the Selection tool.
- In the Properties panel, change the Stroke color to a medium gray.
- In the Color panel, change the two gradient crayon to slightly darker shades.

- Return to Scene 1, drag an instance of Master somewhere out onto the stage in the Buttons layer, and test the movie. Interact with the button to see how it works. Close the SWF and remove the Master instance from the stage.
- Return to editing the Master button.
- Add a new layer at the top of the Timeline panel named Text.
- Use the Text tool with white Color, a simple font at about 18pt, and set to left align.
- Type the word Characteristics over the button so that we are sure that the longest button text will fit as the font style and size you chose. Adjust as necessary so that the text fits easily within the white border.
![]()
- Now, without changing the position or other settings of the text, change the word to Master.
- Save the file.
Arrange the Menu Buttons
We'll need six menu buttons across on the rectangular band of white.
- In the Library panel, right-click on the Master button and select Duplicate...
- In the dialog box, name the duplicate button Home.
- Repeat steps 1 and 2 to create five more buttons:
- Characteristics
- Habitat
- Behavior
- Reproduction
- Conservation
- Make sure all the button symbols end up inside the Buttons folder in the Library.

- Double-click the button icon for the Behavior button symbol.
- Change the text from Master to Behavior.
- Repeat steps 5 and 6 for the other new buttons, giving them each text which matches the symbol name.

- Return to Scene 1.
- Select the Buttons layer and the Selection tool.
- Drag out a copy of each of these buttons in the following order, and line them up on the white rectangle. Precision is not required—we'll let Flash line them up afterward. Do make sure the the outer two buttons have a little white space between them and the edges:

- Click on frame 1 of the Buttons layer to select all six buttons at once.
- Open the Align panel (Window > Align.)
- Uncheck Align to stage.
- Click the Align top edge icon, and then Distribute horizontal center. This will nicely align the buttons and space them evenly.
- With all six buttons still selected, use the arrow keys on your keyboard to move the button set so that they have an even amount of white on the top, bottom, and far left and right.
![]()
- Delect everything by clicking in the gray pasteboard off the stage.
- Click on the Home button on the stage.
- In the Properties panel, give the button an instance name of btnHome.

- Give the other buttons instance names according to this table. These instance names are very important to the functionality of the menu, so make sure you type the names exactly:
| Button | Instance Name |
|---|---|
| Characteristics | btnCharacteristics |
| Habitat | btnHabitat |
| Behavior | btnBehavior |
| Reproduction | btnReproduction |
| Conservation | btnConservation |
- Click in frame 1 of the Actions layer and open the Actions panel.
- Type in the following ActionScript exactly as you see it here. I am making you type (rather than copy-and-paste) in order to help your brain become better familiar with the flow and syntax of ActionScript. Every little quote, semicolon and upper/lowercase letter is very important.

- Test the movie and make sure you don't get any compiler errors (Compiler Errors panel.) You should be able to click on the buttons, but you won't see that you're actually moving the playhead around yet.
- Close the SWF, lock the Buttons layer and save the file.

Build the Home Page Layout
- Pull out some more guides to help align our text and images:
- Horizontal guides at 150px and 575px on the left-hand ruler.
- Vertical guides at 25px, 470px, 490px, and 935px on the top ruler.

- Click in frame 1 of the Home layer in the Timeline panel.
- Import the pallas-cat_female_looking-off-right_small.jpg image to the stage and position it centrally but top-aligned within the new left-hand column created by the guides.

- In the Library, create a new folder called Photos and move the two photo bitmaps into this folder. All of the remaining photos we import should end up in here too.

- Open the pallas-cat.txt file and copy the first full paragraph from it to the clipboard (Ctrl+C on PC, Cmd+C on Mac.)
- Select the Text tool in Flash. Use the following settings in the Properties panel:
- TLF Text
- Read Only
- Arial (or Helvetica)
- Regular
- 26pt
- black
- Left align
- Click and drag on the stage to match the edges of the right-hand column formed by the guides. Dragging out a box gives you paragraph text with text wrap, rather than point text without.

- Paste your text from the clipboard (Ctrl+V on PC, Cmd+V on Mac.)

- Select the cat photograph and text box together by clicking in frame 1 of the Home layer.
- Convert the two objects into a movieclip symbol (F8) named Home.
- In the Properties panel, add an Alpha Color Effect and set the alpha to 0.
- Right-click in frame 1 of the Home layer and select Create Motion Tween.
- Still in the Home layer, move the playhead to frame 9.
- Select the now-invisible movieclip of the cat photo and textbox.
- Return the Alpha setting back to 100%. This will automatically generate a property keyframe in frame 9 of the Home layer.

- Move the playhead to check the animation.
- Test the movie. The home page contents should gradually appear.
- Click on another button, and then back to home. The content area should go back to blank, and then show the animation again at home. The stop command in frame 9 prevents the animation from looping on the home page.
- Close the SWF, lock the Home layer, and save the file.
Build the Interior Page Layouts
We'll be repeating the techniques above to animate the content on the remaining pages.
Characteristics Page
- Click in frame 10 of the Characteristics layer.
- Import the pallas-cat_close-up_edinburgh-zoo_small.jpg to the stage and position it neatly and top-aligned within the right-hand column.
- Paste the Characteristics heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
- Set the heading to 24pt and the paragraph text to 16pt.

- Repeat steps 9 through 15 above to animate this content, but name the movieclip Characteristics, and create the Motion Tween from frames 10 through 19 on the Characteristics layer.
- Test the movie, and click between the Home and Characteristics buttons.
- Close the SWF, lock the Characteristics layer, and save the file.
Habitat Page
- Click in frame 20 of the Habitat layer.
- Import the Pallas's_Cat_area.png to the stage and position it neatly and top-aligned within the right-hand column.
- Paste the Habitat heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
- Set the heading to 24pt and the paragraph text to 16pt.
- Repeat steps 9 through 15 above to animate this content, but name the movieclip Habitat, and create the Motion Tween from frames 20 through 29 on the Habitat layer.
- Lock the Habitat layer and save the file.

Behavior Page
- Click in frame 30 of the Behavior layer.
- Import the pallas-cat_rock-cave_zurich-zoo_small.jpg to the stage and position it neatly and top-aligned within the right-hand column.
- Paste the Behavior heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
- Set the heading to 24pt and the paragraph text to 16pt.
- Repeat steps 9 through 15 above to animate this content, but name the movieclip Behavior, and create the Motion Tween from frames 30 through 39 on the Behavior layer.
- Lock the Behavior layer and save the file.

Reproduction Page
- Click in frame 40 of the Reproduction layer.
- Import the pallas-cat_looking-off-left_rotterdam-zoo_small.jpg to the stage and position it neatly and top-aligned within the right-hand column.
- Paste the Reproduction heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
- Set the heading to 24pt and the paragraph text to 16pt.
- Repeat steps 9 through 15 above to animate this content, but name the movieclip Reproduction, and create the Motion Tween from frames 40 through 49 on the Reproduction layer.
- Lock the Reproduction layer and save the file.

Conservation Page
- Click in frame 40 of the Conservation layer.
- Import the near-threatened_conservation-status.png to the stage and position it neatly and top-aligned within the right-hand column.
- Paste the Threats and Conservation heading and the two paragraphs that follow from pallas-cat.txt into a new text box in the left-hand column.
- Set the heading to 24pt and the paragraph text to 16pt.
- Repeat steps 9 through 15 above to animate this content, but name the movieclip Conservation, and create the Motion Tween from frames 50 through 60 on the Conservation layer.
- Lock the Conservation layer and save the file.

Wrapping Up
- Test the movie and confirm that all the buttons and animations work correctly. Fix anything that's broken.
- Check your Timeline. It should look like this:

- In the Library panel, create a new folder named Movieclips. Move all the movieclip symbols into it. Your final Library should look like this:

- Time to publish the movie so that it is embedded within an HTML file. Go to File > Publish Settings...
- In the Format tab, click the checkboxes for Flash and HTML. Then click on the Publish button at the bottom of the dialog box.

- Close the Publish Settings dialog box and save your Flash file.
- Search for the newly-generated pallas-cat.html file in the same location as your pallas-cat.fla file.
- Open pallas-cat.html in Dreamweaver. Change the <title> element to say Pallas's Cat - the Cat that Time Forgot.
- In the <style> element up in the <head>, add to the body rule so that it looks like this (this will center the SWF in the browser window in Internet Explorer, and change the background color surrounding the SWF to match the cat's eyes):
body { margin:0; padding:0; overflow:hidden; background-color: #828865; text-align: center; }
- Add to the #flashContent rule so that it looks like this (this will center the SWF in the browser window in all other browsers):
#flashContent { width:100%; height:100%; margin: 0 auto; }
- Open the HTML file in a browser and test all of the buttons again. It should work like this demo.
Portal 
Upload the following by midnight of the first class day of week 9:
| Week | Assignment | File Name |
|---|---|---|
| 7 | Basic Website | pallas-cat.zip |
Basic Website
Complete the exercise to the left listed under Exercise: Build a Basic Flash Website. ZIP up the following files together and submit them to the Portal:
- pallas-cat.fla
- pallas-cat.swf
- pallas-cat.html
