This article applies to Adobe Flash CS4 Professional. For the latest information—and especially if you are using Flash Professional CS5—please refer to the updated version of this tutorial, Creating your first Flash Professional CS5 document.
Adobe Flash CS4 Professional is an authoring tool that designers and developers use to create presentations, applications, and other content that enables user interaction. Flash projects can include simple animations, video content, complex presentations, applications, and everything in between. In general, individual pieces of content made with Flash Professional are called applications (or SWF applications), even though they might only be a basic animation. You can make media-rich applications by including pictures, sound, video, and special effects.
The SWF format is extremely well suited for delivery over the Internet because its files are very small. This is due to its extensive use of vector graphics. Vector graphics require significantly less memory and storage space than bitmap graphics because they are represented by mathematical formulas instead of large data sets. Bitmap graphics are larger because each individual pixel in the image requires a separate piece of data to represent it.
To build an application in Flash CS4 Professional, you create vector graphics and design elements with the drawing tools, and import additional media elements like audio, video, and images into your document. Next, you define how and when you want to use each of the elements to create the application you have in mind.
The Stage is where your graphics, videos, buttons, and so on appear during playback.
The Timeline controls the timing of when elements in the movie appear on the Stage. You also use the Timeline to specify the layering order of graphics on the Stage. Graphics in higher layers appear on top of graphics in lower layers.
The Tools panel holds the general set of tools used for selecting objects on the stage and drawing vector graphics.
The Property inspector displays editable information about any selected object.
The Library panel is where media elements and symbols are stored and organized.
ActionScript code allows you to add interactivity to the media elements in your document. For example, you can add code that causes a button to display a new image when the user clicks it. You can also use ActionScript to add logic to your applications. Logic enables your application to behave in different ways depending on the user's actions or other conditions. Flash CS4 Professional uses ActionScript 3.0 when an ActionScript 3.0 or Adobe AIR file is created, or ActionScript 1.0 and 2.0 when an ActionScript 2.0 file is created.
Flash includes many features that make it powerful but easy to use, such as prebuilt drag-and-drop user interface components, built-in motion effects which you can use to animate elements on the Timeline, and special effects that you can add to media objects.
When you have finished authoring your FLA file, you publish it using the File > Publish command (Shift+F12). This creates a compressed version of your file with the extension .swf (SWF). You can then use Flash Player to play the SWF file in a web browser or as a stand-alone application.
In the New Document dialog box, Flash File (ActionScript 3.0) is selected by default. Click OK.
Click the workspace drop-down menu un the upper right of the screen and select the Essentials workspace layout option (see Figure 2).
Click the Properties tab in the upper right side of the user interface to view the Stage properties for the file.
In the Property inspector, located by default vertically along the right side of the workspace, the Size button displays the current Stage size setting as 550 × 400 pixels (see Figure 3). The Background color swatch is set to white. You can change the color of the Stage by clicking the swatch and selecting a different color.
Choose a location for the file on your hard disk, name the file SimpleFlash.fla, and then click Save. Remember this location, because you'll need to find this directory at the end of this tutorial.
Select the Oval tool from the Tools panel (see Figure 4).
Click the stroke color swatch in the Property inspector and select the No Color option from the Stroke Color Picker (see Figure 5).
Select a color of your choice from the Fill Color Picker, located directly below the Stroke Color Picker. Make sure the fill color contrasts well with the Stage color. In this example, we chose a blue fill color with a red Stage color.
With the Oval tool still selected, draw a circle on the Stage by Shift-dragging on the Stage (see Figure 6). Holding the Shift key constrains the Oval tool to a circle.
You can turn your new artwork into a reusable asset by converting it to a symbol. A symbol is a media asset that can be reused anywhere in your document without the need to re-create it. Symbols can contain images and animations along with other types of content.
Click the Selection tool in the Tools panel (see Figure 7).
Click the circle on the Stage to select it. A bounding box selection appears around the circle.
With the circle still selected, choose Modify > Convert to Symbol (or press F8) to bring up the Convert to Symbol dialog box (see Figure 8).
Note: You can also convert a graphic into a symbol by selecting it and dragging it into the Library panel.
If the Library panel is not open, choose Window > Library. The new symbol appears in the Library panel.
Drag the circle to just left of the Stage area (see Figure 9).
Select the circle on the Stage and drag it to the right of the Stage area. This step just created the tweened animation. Notice the dot (keyframe) which appears at frame 24. Also notice the motion guide line showing the path of motion between frame 1 and frame 24 (see Figure 11).
In the Timeline, drag the red playhead back and forth from frame 1 to frame 24 to preview the animation by scrubbing the Timeline.
Add a change in direction in the middle of the animation by dragging the playhead to frame 12 and then moving the circle to another location on the screen. Notice the change in the motion guide line and the new dot on the Timeline at frame 10 (see Figure 12). The dots on the Timeline are keyframes which mark where (at what frame) objects change on the screen.
Experiment with changing the shape of the motion guide path. Click the Selection tool in the Tools panel and then click a section of the motion guide line and drag it to bend the line shape (see Figure 13).
Choose Control > Test Movie to test the FLA file.
Close the Test Movie window.
When you finish your FLA file, you are ready to publish it so it can be viewed in a browser. When you publish the file, Flash Professional compresses it into the SWF file format. This is the format that you place in a web page. The Publish command can automatically generate an HTML file with the correct tags in it for you.
In the Publish Settings dialog box, select the Formats tab and verify that only the Flash and HTML options are selected (see Figure 14). This action causes Flash to publish only the SWF file and an HTML file. The HTML file is used to display the SWF file in a web browser.
In the Publish Settings dialog box, select the HTML tab and verify that Flash Only is selected in the Template pop-up menu (see Figure 15). This template creates a simple HTML file that contains only your SWF file when displayed in a browser window.
Choose File > Publish and open your web browser.
Choose File > Open in the web browser.
Navigate to the folder where you saved your FLA file. The SimpleFlash.swf and SimpleFlash.html files are there. Flash Professional creates these files when you click Publish.
Select the file named SimpleFlash.html.
Click Open. Your application displays in the browser window.
Congratulations! You have now completed your first FLA file.
The Flash Developer Center's Getting Started section outlines where to go next, depending on your interests.
Adobe TV's Flash channel provides many video tutorials that show you what you can do with Flash.
Adobe product manager Doug Winnie's article, Introducing Flash CS4 Professional, discusses how some of the biggest features of Flash CS4 Professional can improve your application development workflow.