DES 461 Multimedia II :: International Academy of Design & Technology

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

Pallas Cat Source Files

Getting the Timeline Set Up

  1. 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.

Flash CS5 edit stage for web browser

  1. Add 8 new layers to the Timeline, and then name your layers as shown below:

Flash CS5 website timeline layers

  1. 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.
  2. 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.

Flash CS5 website timeline keyframes

  1. 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

Flash CS5 website timeline frame labels

  1. Insert a frame (F5) at frame 9 on the Home layer. This will signify the end of the Home page content.
  2. 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

Flash CS5 wesbite content on timeline

  1. 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

Flash CS5 wesbite content on timeline

  1. 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();

Flash CS5 stop command

  1. 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.

Flash CS5 stop command actionscript

  1. 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.

  1. Open up each of the photos in Photoshop (the two non-photo images are already small enough for the site.)
  2. 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.
  3. Save a small JPG copy of pallas-cat_looking-off-left_rotterdam-zoo.jpg at 400x400.
  4. Save a small JPG copy of pallas-cat_female_looking-off-right.jpg at 268x400.
  5. Save a small JPG copy of pallas-cat_rock-cave_zurich-zoo.jpg at 300x400.
  6. The background image of grass in snow (grass-in-snow.jpg) needs an opacity change.
    1. In the Layers panel, locate the lock icon on the left edge of the Background layer.
    2. Drag the lock icon to the trash icon at the bottom of the Layers panel. This converts the layer to a more editable one.
    3. At the top-right of the Layers panel, set the Opacity for this layer to 20%.
    4. Save a small JPG copy of grass-in-snow.jpg at 960x720.
  7. Close all the original image files without saving.

Flash CS5 prepared images

Create the Website Background

Our site background will contain site identification and a simple image.

  1. In Flash, choose View > Pasteboard so that we can see the whole stage in our window.
  2. Choose View > Rulers and pull a horizontal guide down from the top ruler. Line it up with the bottom of the stage.
  3. Select the Background layer in the Timeline panel.
  4. Import grass-in-snow_small.jpg to to stage.
  5. 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.

Flash CS5 website background with guide

  1. 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.
  2. Select the Text tool. In the Properties panel, choose TLF Text and Read Only.
  3. Choose an elegant font at about 60pt and make it black. Make sure it is set to align left.
  4. Click near the top-left edge of the stage and type Pallas's Cat.
  5. Press Enter/Return and reduce the font size to about 30pt. Type The cat that time forgot.
  6. Position the site ID so that it has a little room around it above the first guide.

Flash CS5 create and position the site ID text

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

Flash CS5 tools panel rectangle tool settings

  1. 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.
  2. Lock the Background layer and save the file.

Flash CS5 rectangle and lock background layer

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.

  1. Insert > New Symbol
  2. For Name, type in Master. For Type, choose Button. Click OK.
  3. In the Library panel, create a new folder using the New Folder icon at the bottom of the panel.
  4. Name the new folder Buttons and drag your Master button into this folder.
  5. In the Timeline, name the current layer Background.
  6. Insert a frame (F5) in the Hit frame for this layer.
  7. Select the Rectangle tool and use these settings:
    1. Stroke: none
    2. Fill: a dark color
    3. Object Drawing: on
    4. Rectangle Options (bottom of Properties panel): all four corners at 15.00.
  8. Draw a rectangle on the stage which is 25px tall and 150px wide. You may want to use guides to get this exact.

Flash CS5 button background rounded corner rectangle

  1. Add a new layer and name it Gradient.
  2. Select and copy the shape on the stage. Lock the Background layer.
  3. Go back to the Gradient layer and Edit > Paste in Place.
  4. Zoom way in so you can see what you are doing.
  5. 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.

Flash CS5 free transform button shape

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

Flash CS5 apply a stroke and linear gradient

  1. 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.

Flash CS5 transform gradient for button background

  1. 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.

Flash CS5 change gradient color crayon stops

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

Flash CS5 button timline layers keyframes

  1. Return to the Over frame, and select the gradient shape with the Selection tool.
  2. Convert it to movieclip symbol (F8) named Hover-effect.
  3. 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.
  4. 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.
  5. Add a keyframe (F6) in frame 10 of the single layer.
  6. At frame 10, use the Gradient Transform tool to flip the gradient 180°.

Flash CS5 button gradient flipped

  1. Right-click in between frames 1 and 10, and select Create Shape Tween.
  2. Test the animation by dragging the playhead.
  3. 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.

Flash CS5 button animation timeline

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

Flash CS5 change gradeint and stroke in down frame button

  1. 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.
  2. Return to editing the Master button.
  3. Add a new layer at the top of the Timeline panel named Text.
  4. Use the Text tool with white Color, a simple font at about 18pt, and set to left align.
  5. 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.

Flash CS5 button text

  1. Now, without changing the position or other settings of the text, change the word to Master.
  2. Save the file.

Arrange the Menu Buttons

We'll need six menu buttons across on the rectangular band of white.

  1. In the Library panel, right-click on the Master button and select Duplicate...
  2. In the dialog box, name the duplicate button Home.
  3. Repeat steps 1 and 2 to create five more buttons:
    • Characteristics
    • Habitat
    • Behavior
    • Reproduction
    • Conservation
  4. Make sure all the button symbols end up inside the Buttons folder in the Library.

Flash CS5 duplicate the button symbol

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

Flash CS5 edit text to match button name

  1. Return to Scene 1.
  2. Select the Buttons layer and the Selection tool.
  3. 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:

Flash CS5 lay out buttons for website navigation

  1. Click on frame 1 of the Buttons layer to select all six buttons at once.
  2. Open the Align panel (Window > Align.)
  3. Uncheck Align to stage.
  4. Click the Align top edge icon, and then Distribute horizontal center. This will nicely align the buttons and space them evenly.
  5. 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.

Flash CS5 align and distribute buttons

  1. Delect everything by clicking in the gray pasteboard off the stage.
  2. Click on the Home button on the stage.
  3. In the Properties panel, give the button an instance name of btnHome.

Flash CS5 give the button an instance name

  1. 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
  1. Click in frame 1 of the Actions layer and open the Actions panel.
  2. 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.

Flash CS5 button actionscript functions

  1. 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.
  2. Close the SWF, lock the Buttons layer and save the file.

Flash CS5 website interface with buttons no content

Build the Home Page Layout

  1. 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.

Flash CS5 home page layout guides

  1. Click in frame 1 of the Home layer in the Timeline panel.
  2. 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.

Flash CS5 import photo to stage and position it

  1. 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.

Flash CS5 library folder organization photos

  1. 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.)
  2. 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
  3. 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.

Flash CS5 paragraph text box

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

Flash CS5 paste text into text box

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

Flash CS5 motion tween with property keyframe

  1. Move the playhead to check the animation.
  2. Test the movie. The home page contents should gradually appear.
  3. 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.
  4. 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
  1. Click in frame 10 of the Characteristics layer.
  2. 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.
  3. Paste the Characteristics heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
  4. Set the heading to 24pt and the paragraph text to 16pt.

Flash CS5 wesbite characteristics page layout

  1. 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.
  2. Test the movie, and click between the Home and Characteristics buttons.
  3. Close the SWF, lock the Characteristics layer, and save the file.
Habitat Page
  1. Click in frame 20 of the Habitat layer.
  2. Import the Pallas's_Cat_area.png to the stage and position it neatly and top-aligned within the right-hand column.
  3. Paste the Habitat heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
  4. Set the heading to 24pt and the paragraph text to 16pt.
  5. 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.
  6. Lock the Habitat layer and save the file.

Flash CS5 habitat page layout

Behavior Page
  1. Click in frame 30 of the Behavior layer.
  2. 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.
  3. Paste the Behavior heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
  4. Set the heading to 24pt and the paragraph text to 16pt.
  5. 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.
  6. Lock the Behavior layer and save the file.

Flash CS5 behavior page layout

Reproduction Page
  1. Click in frame 40 of the Reproduction layer.
  2. 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.
  3. Paste the Reproduction heading and the paragraph that follows from pallas-cat.txt into a new text box in the left-hand column.
  4. Set the heading to 24pt and the paragraph text to 16pt.
  5. 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.
  6. Lock the Reproduction layer and save the file.

Flash CS5 Reproduction page layout

Conservation Page
  1. Click in frame 40 of the Conservation layer.
  2. Import the near-threatened_conservation-status.png to the stage and position it neatly and top-aligned within the right-hand column.
  3. 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.
  4. Set the heading to 24pt and the paragraph text to 16pt.
  5. 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.
  6. Lock the Conservation layer and save the file.

Flash CS5 Conservation page layout

Wrapping Up

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

Flash CS5 final Timeline

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

Flash CS5 Library panel with folder organization

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

Flash CS5 publish settings dialog box

  1. Close the Publish Settings dialog box and save your Flash file.
  2. Search for the newly-generated pallas-cat.html file in the same location as your pallas-cat.fla file.
  3. Open pallas-cat.html in Dreamweaver. Change the <title> element to say Pallas's Cat - the Cat that Time Forgot.
  4. 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; }

  1. 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; }

  1. Open the HTML file in a browser and test all of the buttons again. It should work like this demo.

Portal go to 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