For updates and discussion on this tutorial, visit:
http://kdmc.berkeley.edu/tutorials/flash-intro/
Introduction
Adobe Flash is a powerful vector-based animation tool that has become the de facto standard for multimedia on the Internet because it allows authors to create online presentations with minimum file sizes.
With Flash, Web presentations can blend text, pictures, video, audio, interactive buttons and animated charts and graphs. Flash is also becoming a rich ground for multimedia journalism, because its interactivity lends itself as a medium to non-linear, reader-directed storytelling.
We take a two-pronged approach to teaching Flash. This tutorial is a basic entry-level introduction to Flash. It will cover how to use the timeline to make a simple animated photo slideshow. The second step is creating a self-contained program with interactive buttons and media, which can be found in this tutorial.
This tutorial was written using Flash CS4. Some of the screenshots may not match exactly if you are using earlier versions of Flash, but this tutorial will be applicable to people using Flash versions 8 and above.
A 30-day trial version of Flash can be downloaded from Adobe's Web site (registration required):
Flash is also sold in packaged "suites" by Adobe at greatly reduced prices.
Starting Out With Flash
This tutorial will take you through the process of creating a photo slideshow in Flash step-by-step. If you don't have a copy of the Flash authoring program, you can download a 30-day trial version from Adobe's Web site: http://www.adobe.com/products/flash/. You can also download a copy of the finished .fla file of this tutorial here.
File Types in Flash
There are many file types you will deal with in Flash, but only two are the most common:
.FLA - This is the extension of the main project file that you will be working on.
.SWF - Pronounced "swift", this is the exported Flash file that will go on the Web when you're done.
It's important to know that the .FLA contains all of the media that you import into Flash. For example, if you import 10 photos into your library, those photos will be stored in the .FLA file and will be available to any person who opens the .FLA from their computer. Another thing to know about the .SWF file is that it is locked. This means that you cannot give someone a .SWF to open and manipulate; it is considered the finished exported project.
Here are some other, more rare, file types you may encounter in advanced Flash situations:
.FLV - This is a Flash Video file. It cannot be opened on a computer without a special player.
.AS - This is a special ActionScript file that has code that some advanced projects need.
.MXP - This is a Flash component file that you can install on your computer. Many components are downloadable from the Internet. If you find one, you will have to install it only once.
Creating a Slide Show in Flash
First, let's take a look at the finished product:
As you can see, this slideshow has four photos. Here's what is happening:
1) It starts out blank 2) A photo fades up 3) Displays for a brief second 4) Then fades out while the next photo fades up.
We will manually create each four steps of these fades from scratch using a mechanism in Flash called tweening. Let's take a look at the completed timeline:
While this may look confusing a first glance, it becomes simple once we break down each element. Each bar on the timeline represents a different layer of the project. When creating animation using tweens, each layer can only have one element on it; in this case, a photograph. The dots represent keyframes, which are special frames that indicate change. In this case, these points indicate the start and end points of the fades.
Workspace
After you first launch Flash, you will be presented with a Welcome window. You are required to make a selection to begin using Flash, however you can check the box to prevent this window from opening again.
There are several options in the center column based on the type of project you wish to begin. For Flash projects, you will only want to select one of the two first choices. The biggest decision you have will be whether to create a project in ActionScript 2.0 or ActionScript 3.0.
ActionScript
ActionScript (AS) is a programming lanuage that Flash uses to create interactivity. Recently, Adobe updated the version of ActionScript to create many new features for advanced programmers. While advanced programmers have praised the new lanuage, it has become less user-friendly to beginners.
Since the two languages are incompatible — meaning projects created with ActionScript 2.0 cannot be opened in ActionScript 3.0 — Adobe has decided to keep its support for ActionScript 2.0 for the time being.
This beginning tutorial uses minimal ActionScript, so it doesn't matter which version you pick at this point. However, we will proceed by clicking ActionScript 3.0.
Workspace
After Flash launches, you should first set your workspace to the way you like it. In Flash CS4, several new workspace "presets" were created, offering traditional users a way to create environments they were more familiar with. Since we are writing this tutorial to cater to previous versions of Flash, we will use the "Classic" workspace.
Adobe Flash 8 or CS3 users should select Window --> Workspace --> Default Adobe Flash CS4 users should click Window --> Workspace --> Classic
Let's take a look at the Flash CS4 workspace.
Timeline: At the top of the screen is the Timeline. It is important to note that the Timeline is a frame-based timeline, not time-based. This means each of the squares represents one-frame of time — similar to a film strip or a flip-book.
Tools: At the left of the screen are the tools. The one important thing to note here is that the black arrow tool, also known as the Selection Tool, is the primary tool to move objects around. The white arrow, known as the sub-selection tool, is used for a completely different purpose (manipulating vector graphics). You should always use the black arrow. In fact, you will only rarely use the white arrow tool.
Stage: In the middle is the white area known as the Stage. This is the main preview area where your content will be placed. Content here can change based on where you are at in the Timeline. Surrounding the white area is a gray area known as the pasteboard. You can place objects off-stage on the pasteboard, but they will not be visible viewers who visit your site. Keeping unused items in the pasteboard area will export with your final movie, possibly increasing the filesize, so it's not good practice to keep unused items in this area.
Palettes: On the right are several icons and boxes. These are all for controlling various settings for different features. You can click the icons to pull up extra windows, or drag windows around to attach them to other areas of your workspace.
Important - Expand the Library!
In the Classic view of Flash CS4, the Library is contracted into an icon. Click on the center icon that looks like some books (see image above). You can click and drag this icon to the right so that it snaps to the properties window.
Library: The library is an important aspect of Flash. It is where all of the media that is a part of your project is stored. Any time you import media into your project, such as an image or an audio file, it will be stored in your library. Your library also acts as bin for "master copies" of media in your project. For example, let's say you have a photo in your project, and you replace the library copy of this photo (by right-clicking and selecting properties), it will automatically replace every instance of that photo throughout your whole project.
Property Inspector: Lastly is the properties window, also called the property inspector. This window will show you settings for various things in Flash. Most importantly, you should know that the properties window is acontextual window and will change based on what you click. So if you click in your Timeline, it will show you the settings for your Timeline. If you click on the Stage, it will display settings for your stage.
The properties window will display on the bottom of the screen in Flash 8 and CS3:
Setting the Stage Size in Document Properties
The size of your Stage will determine the size of your Flash project when you embed it on a Web page. Figuring out what size to make your Flash project can be a tricky process, because this is something you generally don't want to set later, or else you may have to redo a lot of work. Generally, you want to mock-up your project in another program, like Photoshop, and then import the elements into Flash.
In our case, we will set the document size to the same size as the photos we will be using for the slide show; which is 400 pixels wide and 300 pixels high.
Setting the Stage size in Adobe Flash CS4
In Adobe Flash CS4, click on the Edit button in the Properties window under the Properties section. Remember, the properties window is contextual, so if you don't see this option, then click on the Stage first.
In the document properties window, set the Stage size to 400 x 300 pixels, and set the framerate to 15 frames-per-second.
The framerate is a value you that you can change at any time when creating your Flash project, and it won't affect anything your have already done in your project. The faster the framerate, the smoother and quicker animations will play. For our purposes, we found 15 to work well, but you can change this to 24 or 30 fps to see the differences in speed.
Setting the Stage size in Adobe Flash 8 or CS3
If you are using Adobe Flash CS3, the document properties are in a slightly different location. Click on the Stage size button in your Property Inspector bar at the bottom of your screen. Remember, you may have to click on the Stage first if this option is not present.
In the document properties, there are some additional fields. You can leave these blank for now. Filling these out would identify the Web page you embed your Flash project on in the last step; should you choose to let Flash create a Web page for you.
For this tutorial, set your stage size to 400 x 300, and the framerate to 15 fps.
Importing Images
The first step in building our slide show will be to import the images into the Flash program.
If you haven't done so already, start a new Flash project, and select ActionScript 3.0 from the Welcome window. Next save your project in a folder you can easily find.
You can download the four sample photos by right-clicking (Control-click on Mac) on the links below and saving the images to the folder where you will be working from:
OR you can right-click (Control-Click on Mac) on the sample images themselves, and save them to the folder where you will be working from:
To import these images into Flash, go to the File menu and select Import --> Import to Stage.
The Import to Stage option will also place the photos in your Library. The only difference between "Import to Stage" and "Import to Libarary" is that one will also place the photos directly on your Stage.
Next, hold down the shift key and select all four of the photos so you can import them at the same time.
Click import. After importing, it is really important to not click on the images on the Stage. You will only see one image, that is because they are stacked perfectly on top of each other. (Your top image may be different than the example)
All four images will have a border around them (colors may vary depending on the Flash version you are using) to indicate they are selected.
The next step is to align them property with the Stage. We want to make sure to get it exact, so we will use a special align option built into Flash. Click on the Window menu and select Align.
The align window will appear on the right side. There are several options for aligning elements on your Stage using this window. The aligning options allow you to either align elements with each other, or in relation to the Stage. We will align these images with the Stage, so you should turn on the To Stage button at the right (see the cursor in the image). It will darken to indicate it is selected.
Next, you will want to align your images to the vertical center and horizontal center. The buttons to do this are in the middle of each of the align segments (circled in red). If some of your images did not align properly, it may have been because one of the images was accidentally de-selected. To fix this, click Ctrl-A (Command-A for Mac) to select all of the images on your Stage and press the proper align buttons again.
Once your images are property aligned to the Stage, and no white is showing, you can proceed to the next step.
Click on the Modify menu and select Timeline --> Distribute to Layers.
This will put each image on its own layer, as well as automatically name each layer based on the image name.
Whenever you do a "Distribute To Layers," it will take every element currently selected on the Stage, and place it in a separate layer. If everything on the Stage is selected, then it will leave the existing layer empty. We can delete this top Layer1 since it is empty and we will not be using it. To delete it, select Layer 1 and click the trash can icon at the bottom of the timeline.
Converting to Symbols
Symbols are abstract elements in Flash. The best way to describe them would be to think of them as containers. When you convert an image to a Symbol, you aren't actually converting it as much as you are placing it inside a Symbol container.
Why do you need to do this? Well, Flash doesn't really have the ability to do much with objects that are on the Stage. But, if you place an object inside of a Symbol, Flash can manipulate properties of that Symbol. For example, it can move it around the Stage, stretch it out, or change its transparency — which is the property we are going to change to make the images fade.
Grasping the concept of Symbols is not easy. It is best to work with them for a little bit, and you will quickly understand the way Symbols work. Just remember:
When you should convert an object to a Symbol: When you want to animate, stretch, fade, position, move, make clickable or interact with an object on your Stage.
When you do not need to convert an object to a Symbol: When the object is static and will not change at all, like a background image or a logo.
Converting your Images to Symbols
Converting an image to a symbol is generally very easy to do, however in our case it is a little trickier since we want each of our four images to be converted to their own symbol. We will have to first hide some of the images to make sure we only convert one image at a time into a symbol.
Click the small dots under the eye icon to hide the top three layers.
You will see the images on those layers disappear.
Next, and this is important, click once on the image that is showing on your stage to select it.
Under the Modify menu, select Convert To Symbol.
If the option is grayed out, it means you haven't selected the image on the Stage. Click once on the image that is on the Stage first.
Type the name of the image in the symbol dialogue box, and choose Graphic for the type option.
The registration won't really matter in this tutorial, so you can leave the upper-left box checked, and for people using CS4, the Folder option can remain Library Root.
You will know you were successful in converting the image to a symbol if you see a small circle appear in the center of the image. The border may be a different color depending on the Flash version you are using.
Now hide the layer with the image you just converted to a symbol and reveal the next layer up.
Repeat the process of converting the image to a graphic symbol, naming it appropriately. Do this will all four images so that they are all symbols.
About the different types of symbols
There are three types of symbols: MovieClip, Button and Graphic. This is an introductory tutorial, so we will only be using Graphic symbols, but it is good to understand the differences between the different symbols.
A Graphic symbol is mostly used by animators. It is essentially the most basic of symbols and offers the ability to animate objects in your Flash project. It also has certain properties that allow you to see the animation play out inside the symbol as you scroll through your timeline.
A Button symbol is just what it sounds like. It is a basic symbol that allows you to create buttons with roll over effects. You can also give button symbols an instance name, which allows you to add functionality with ActionScript code.
A MovieClip is the most advanced type of symbol. It is much like a graphic symbol, except you can give it and instance name so you can manipulate it with ActionScript code -- something you cannot do with Graphic symbols. Almost all moderate to advanced projects require the use of MovieClip symbols.
Add Frames and Keyframes
Now that we have converted our images into symbols, we can now build out our timeline by adding some frames.
Click once on Frame 44 in the top layer to select it.
Then, while holding down your shift key, and click once on frame 44 in the bottom layer. This will select all of the frames inbetween.
In the Insert menu, select Timeline --> Keyframe.
Now, select the entire column of frames on frame 10 using the same technique as you did with frame 44. Click once on the top frame of frame 10, hold down shift, then click once on the bottom.
Insert a keyframe in column 10 as well by going to the Insert menu, and selecting Timeline --> Keyframe.
Repeat this process one more time for frame 35.
Your timeline should look like the timeline above at this point, with keyframes (black dots) at 1, 10, 35 and 44.
What are keyframes?
Keyframes represent change in a particular layer of a timeline. If you can imagine a flip book that animates as you snap the pages with your thumb; each of those pages would be a separate keyframe in Flash, because each page is different. The gray bars simply represent time where nothing is changing.
The reason why we placed keyframes at frames 1 and 10 is this will be the space where the photos fade up. The space between frames 10 and 35 will simply display the image, and frames 35 to 44 will fade out the image.
The small white squares in the timeline are absolutely meaningless. Well, actually they represent the end of a keyframe section, but you can already tell that because there is another keyframe just after it. So just ignore the little white squares.
(Why did we choose frame 44 for the end? While it is not really necessary, it helps us keep the fade segments aligned later on in this tutorial. Because the timeline starts on frame 1 and not on frame 0, using frame 44 will match each fade as 9-frames long by the end of this project.)
Tweens and Animation
The next step for us will be tweening the animation of the photos fading up and fading out.
If you may have wondered why all of the layers and keyframes are stacked perfectly on top of each other at this point, it is because we are taking a bit of a shortcut by creating all of the keyframes and tweens first, then we will move each piece of the timeline to cascade it out in the last step.
Setting the Alpha (transparency) of the images for the fades
To make the fades, we must first set the transparency to invisible in the first and last frames of our timeline.
To do this, first select all of the keyframes in frame 1 of your timeline using the same method as the last page. Need a refresher? First click on the top keyframe, hold down shift, then click on the bottom keyframe.
Next, and this is important, click once on the image showing on the stage (maybe different than the example):
The reason why we click on the image is to change the options offered to us in the Properties Window. Without clicking on the image, the properties window would only display options for the timeline, not the object on the Stage.
For Flash CS4: In the Properties Window, find the section for Color Effect, and set the style property to Alpha.
Alpha refers to the amount of transparency of the symbols currently selected (which is all of them). Move the slider to set the Alpha to zero, meaning completely invisible.
For Flash 8 and CS3: In the Property inspector at the bottom of the screen, set the Color setting to Alpha.
Alpha refers to the amount of transparency of the symbols currently selected (which is all of them). Move the slider to set the Alpha to zero, meaning completely invisible.
All versions: What we have done is set all of the symbols to be invisible in that first keyframe. Since Flash cannot adjust the transparency of images alone, we had to convert them to symbols in order to do this. We selected all of the keyframes in the timeline, thus selecting all of the symbol in that first keyframe at once.
Next, we are going to these steps, but with the last keyframe — frame 44.
Highlight frame 44 in all layers.
Click once on the image that is displayed on the Stage.
Then set the Alpha to zero in the properties window.
One you have set the last set of keyframes to 44, you have completed setting the in-and-out points of the fades. If you click on the red playhead (click up where the frame numbers are) and drag it back and forth through your project, you will see the images disappear and reappear in the proper keyframes.
Tweening the animation of the fades
A tween refers to "animation" in Flash. We have the alpha set on the correct keyframes, but now we need to actually see the gradation of invisible to visible of the photos.
A tween in Flash works like this: It analyzes two keyframes, sees how they are different from each other, then it will automatically animate the frames in-between the two keyframes. The term "Tween" is a throwback to the days of animation when in-betweeners would do the grunt work of animating the motion. Now Flash does that job.
Click and select all of the keyframes on frame 1.
For Adobe Flash CS4: Click on the Insert menu and select Classic Tween.
For Adobe Flash 8 and CS3: In the property inspector at the bottom of the screen, set the Tween option to Motion.
For all versions: A line with an arrow will appear from one keyframe to the next. This line represents the fade animation. If you drag the red playhead back-and-forth over this section, you will see all of the photos fade up together.
Now follow the same steps in creating a tween for FRAME 35. You do not want to create a tween on the last frame, but rather on 35. This is because we want the animation to go from visible (frame 35) to invisible (frame 44).
Your timeline show look like the one above.
Understanding Tweens and Classic Tweens
Back in the days of early animation, a lead artist would draw only very few frames of the cartoon characters in a film or show. These drawing were called the key frames, thus the term. Then these keyframes were handed to an apprentice called an in-betweener or tweener for short. The apprentices would build their skills by drawing all of the in-between frames to imitate the appearance of motion.
Flash works much the same way. It started out as an animation program and it works by taking the various keyframes you've added tweens to and comparing them. If it sees one frame as having an alpha at 100% and another with an alpha at 0%, it will animate that transition by filling in all of the frames in-between.
It will also consider motion, as in the example below:
In Adobe Flash CS4, a new easier type of Motion Tween was created that allows you to animate without having to insert keyframe first. Instead, you create the tween first and then as you manipulate the animation, keyframes are automatically added by Flash depending on where the playhead is at in the timeline.
We elected to not show this new method of tweening, thus keeping this tutorial compatible with older versions of Flash. Adobe has preserved the old way of making tweens by calling them Classic Tweens.
A shape tween is an animation applied to vector graphics that are drawn in Flash (or another vector-based program). You cannot apply a shape tween to images or symbols.
A motion tween is an animation applied to a symbol. You can put just about anything inside a symbol: a graphic, an image or even a video.
Cascading the Layers
Now that the animation is complete, the last step is to position the frames so that they play one after the other.
Click once on the first keyframe in the second layer.
Hold down the shift key, and select frame 44 in the last layer.
By doing this, you will have highlighted the lower three layers. Now click on the selection and drag it to the right until you reach frame 35, overlapping with the last tween segment. Careful, if you click and hold down too long without moving the mouse arrow, a contextual menu will pop up.
Be sure you are not placing the frame end-to-end, or moving them up or down. Remember, if you mess up, just press Ctrl-Z (Command-z for Mac) a few times to undo.
Compare your timeline with the image above. (We've deselected the frames to see them better). Make sure you have overlapped the tweened regions. This will create a crossfade, so as one image fades out, the next one begins to fade in.
Now repeat the following steps with the other layers, to cascade them out like stairs. You will highlight the two lower layers and drag them to the right, making sure to overlap the tweened regions.
By the time you have dragged all of the layers out, your timeline should be cascaded out as so.
To test your project, click Ctrl-Enter (PC) or Command-Return (Mac).