If you're planning to publish your animation on the Web, you need to know how long it takes your animation to download from a web server to somebody's computer. Chapter 20 gives you several optimization techniques, including tips for preloading content and reducing your animation's file size; but before you begin to optimize your animation, you need to know just how bad the situation is and where the bottlenecks are. The following sections show you how.
You could set up a bank of test machines, each connected to the Internet at a different transfer speed, to determine the average download time your audience will eventually have to sit through. But Flash gives you an easier option: simulating downloads at a variety of transfer speeds with the click of a button. The simulation takes into consideration any additional, non-Flash media files that you've included in your animation, like sound and video clips.
To simulate different download speeds:
Choose Control→Test Movie→in Flash Professional.
The Flash Player (test window) appears.
Select View→Download Settings (Figure 19-6), and then, from the submenu, select the connection speed you expect your audience to be running.
Your choices range from 14.4 (1.2 KB/s) to T1 speed (131.2 KB/s). If you need to simulate a faster speed, check out Figure 19-7.
Figure 19-6. If you're used to testing your animation inside the Flash development environment, you'll be shocked when you see how long it takes to download and play your animation over the web. Flash automatically adjusts for standard line congestion to give you a more realistic picture. So, for example, when you choose the 14.4 kbps setting, Flash actually simulates the transfer at the slightly lower rate of 12.0 kbps.
Unless you're planning to let only certain folks view your animation (for example, students in your company's training classes), you can't possibly know for sure what connection rates your audience will be using. The best approach is to test a likely range. If the animation plays excruciatingly slowly at the lowest connection speed in your test range, consider either optimizing or offering a low-bandwidth version. Chapter 20 (Ten Optimization Strategies) tells you how.
Figure 19-7. To keep up with the latest advances in transfer technology, you can select a faster transfer rate than any of the options Flash has. To do so, select View→Download Settings→Customize, and then type a label and the new transfer speed you want to test (from 1 byte per second to 10,000,000).
Choose View→Simulate Download.
The test window clears, and Flash plays your animation at the rate it would play it if it had to download your file from a web server at the connection speed you chose in step 2.
Repeat steps 2 and 3 for each connection speed you want to test.
If you're like most folks, you'll find that your animation takes too long to play at one—or even all—of the simulated connection speeds you test. Fortunately, Flash gives you additional tools to help you pinpoint which frames take longest to download (so that you know which frames to optimize). Read on for details.
Simulating downloads at different connection speeds gives you a general, overall feel for whether you'll need to optimize your animation or give your audience a low-bandwidth alternative (or both). But to get more precise information, like which frames represent the greatest bottlenecks, turn to the bandwidth profiler report (Figure 19-8).
Figure 19-8. Flash assumes you want it to display your bandwidth reports in Streaming Graph format, as shown here, unless you tell it otherwise. Unfortunately, analyzing the graph on this kind of report can be tricky; to match a stacked segment to a particular frame, you have to click the stacked segment. When you do, Flash displays the associated frame in the Frame field on the left side of the report.
To generate a bandwidth profiler report:
Choose Control→Test Movie→in Flash Professional.
The Flash Player (test window) appears containing your running animation.
In the test window, select View→Bandwidth Profiler.
In the top half of the window, Flash displays a report similar to the one in Figure 19-8.
Select View→Frame By Frame Graph.
The graph Flash displays when you choose the Frame By Frame option makes detecting rogue frames much easier than if you stick with Flash's suggested View→Streaming Graph option shown in Figure 19-8. Figure 19-9 has an example of a Frame By Frame graph.
Select View→Simulate Download.
The progress bar at the top of the bandwidth profiler report moves as Flash simulates a download.
Figure 19-9. On the left side of this Frame By Frame bandwidth profiler report, you see animation properties pertinent to playback, including the .swf file size and the stage dimensions and frame rate you set in Flash. The right side of the report shows you a frame-by-frame picture of the download process. Frame bars that appear above the red line (here, Flash has drawn the red line at 400B) mean a wait for data. So Frame 1, along with most of the frames between Frame 10 and Frame 22, are the culprits in this slow-playing animation; at a connection speed of 56 kbps, they make Flash pause the animation while they're being downloaded.
The report gives you information you can use to figure out which frames of your animation are hogging all the bandwidth. You'll find a timeline and a playhead at the top of the report. As your animation plays, the playhead moves along the timeline to help you see at a glance which frames are causing Flash to display those tall bandwidth-hogging frame bars. Preload, the most useful number, tells you how long your audience has to sit and wait before your animation begins. These are the details you'll find in the bandwidth profiler report:
Dimensions (Dim). The width and height of the stage in pixels (Setting Document Properties).
Frame rate (Fr rate). The frame rate you set for this animation (Setting a Document Frame Rate).
Size. The size of the .swf file Flash created when you exported (began testing) the movie.
Duration. The number of frames in this animation, followed by the number of seconds the frames take to play based on the frame rate you set.
Preload. The total number of seconds it takes Flash to begin playing the animation at the bandwidth setting you chose (see Publishing Your Animations).
Bandwidth. The connection simulation speed you chose by selecting View→Download Settings.
Frame. The frame Flash is currently loading.
If your animation played just fine, try testing it using a slower simulated connection. (Your goal is to make sure as much of your potential audience can enjoy your animation as possible—even folks running over slow connections and congested networks.) To do this test, redisplay the bandwidth profiler report, this time using a different connection simulation speed:
Choose View→Download Settings.
A submenu menu appears, showing a list of possible connection simulation speeds, like 28.8, 56K, and T1.
Choose the new simulation speed you want to test. Then choose View→Simulate Download again.
A new bandwidth profiler report appears, based on the new connection speed (Figure 19-10).
Figure 19-10. Oh, what a difference a faster connection speed makes! Here, every last one of the frames in the animation appears below the red line that Flash has drawn at 10.9 KB, meaning that audiences running T1 connections don't have to wait one split second for the animation to download and begin playing.