Testing Flash Movies


You have four ways to test your Flash movies: in the authoring environment using the Control ð Play command, in the authoring environment using the Test Movie and Test Scene commands, in a browser using the Publish Preview command, or in the stand-alone Flash Player using Flash movie files (.swf) made with the Publish or Export Movie commands. There are several reasons why you should test your Flash movie file (.swf) before you transfer Flash movies to your Web server or to the intended delivery medium:

  • Flash documents files (.fla) have much larger file sizes than their Flash movie file (.swf) counterparts. To accurately foretell the network bandwidth that a Flash movie requires, you need to know how large the final Flash movie will be. If the download demand is too overwhelming for your desired Internet connection speed (for example, a 56K modem), you can go back and optimize your Flash document.

  • The Control ð Play command in the Flash authoring environment does not provide any streaming information. When you use the Test Movie or Scene command, you can view the byte size of each frame and how long it will take to download the .swf file from the Web server.

  • Movie Clip animations and actions targeting Movie Clip instances cannot be previewed using the standard Control ð Play command (or the Play button on the Controller) in the Flash authoring environment.

    Tip 

    You can temporarily preview Movie Clip symbol instances within the Flash authoring environment (for example, the Timeline window) by changing the Symbol instance behavior to Graphic instead of Movie Clip. Do this by selecting the instance, opening the Property inspector, choosing Graphic in the Behavior drop-down menu, and setting the playback menu to Play Once or Loop. However, if you switch the behavior back to Movie Clip, you will have lost the original instance name of the Movie Clip.

  • Most scripting done with Flash actions, such as loadMovie(), loadVariables(), and startDrag(), cannot be previewed with the Play command. Enabling Simple Frame Actions or Simple Buttons in the Control menu has no effect with newer scripting actions. You need to use Test Movie to try out most interactive functions in a Flash movie.

    Tip 

    Any actions that require the use of remote server-side scripts, Flash Remoting, or Flash Communication Server MX connections to load variables, movies, or XML data, will work in the Test Movie environment. You do not need to view your .swf files in a browser to test these actions, unless your server-side functionality has IP address restrictions that would prohibit playback from your local machine.

  • Accurate frame rates cannot be previewed with the Play command (Control ð Play) in the authoring environment. Most complex animations appear jerky, pausing or skipping frames when the Play command is used.

Using the Test Scene or Test Movie Command

You can test your Flash movies directly within the Flash 8 interface by using the Control ð Test Movie or Test Scene command. When you choose one of these commands, Flash 8 opens your Flash document in a new window as a Flash movie file (.swf). Even though you are only "testing" a Flash movie, a new .swf file is actually created and stored in the same location as the Flash document file (.fla). For this reason, it is a good idea to always save your Flash document before you begin testing it.

Caution 

If your movie is currently titled Untitled-1, Untitled-2, and so on in the application title bar, it usually indicates that the document has not yet been saved. Make sure you save your Flash movie with a distinct name before testing it.

New Feature 

Flash 8 now opens all tested movies in a separate nontabbed window. On the Windows version of Flash 8, the Test Movie window now hosts the playback and debugging commands. On the Mac version of Flash 8, the application menu bar changes depending on which type of tab or window was focused (authoring document versus movie file).

Before you use the Test Scene or Test Movie command, you can specify the settings of the resulting Flash .swf file. The Test Scene or Movie command uses the specifications outlined in the Publish Settings dialog box to generate .swf files. We discuss the Publish Settings dialog box later in this chapter. For the time being, you can use the Flash 8 default settings to explore the Test Scene and Movie commands.

Test Movie

When you choose Control ð Test Movie (Ctrl+Enter or z+Enter), Flash generates an .swf file of the entire Flash document that is currently open. If you have more than one Flash movie open, Flash 8 creates an .swf file for the one that is currently in the foreground and that has "focus."

Tip 

If you use Flash Professional 8, you can publish multiple .fla files at the same time by using the Project panel. To learn more about this feature, read Chapter 3, "Planning Flash Projects."

Test Scene

If you are working on a lengthy Flash document with multiple scenes, you may want to test your scenes individually. You can do this by using Control ð Test Scene (Ctrl+Alt+Enter or z+Option+Enter). The process of exporting large movies via Test Movie may require many minutes to complete, whereas exporting one scene will require a significantly smaller amount of time. Movies that require compression for several bitmaps and MP3 sounds usually take the most amount of time to test. As you'll see in the next section, you can analyze each tested scene (or movie) with the Bandwidth Profiler.

Tip 

You can use the Test Scene command while in Edit mode to export an .swf file that contains the current symbol timeline. The movie won't contain anything else from your Flash document. Note that the symbol's center point will become the top-left corner of the playback stage.

image from book
One Reason to Use Imported MP3 Files

If you have imported raw audio files such as .wav or .aif files into your Flash document, you may notice lengthy wait times for the Test Movie or Publish commands to complete. Why? The default MP3 encoding process consumes much of the computer processor's power and time.

Flash 8 has three MP3 compression qualities: Fast, Medium, or Best. Fast is the default MP3 quality setting — this is by far the fastest method of encoding MP3 sound. Because MP3 uses perceptual encoding, it compares a range of samples to determine how best to compress the sound. Fast compares a smaller range of samples than either Medium or Best. As you increase quality, the sampling range increases.

This process is similar to building 256-color palettes for video files; it's best to look at all the frames of the video (instead of just the first frame) when you're trying to build a palette that's representative of all the colors used in the video. While MP3 doesn't quite work in this fashion, the analogy is appropriate. So, at Best quality, the MP3 encoding scans more of the waveform to look for similarities and differences. However, it's also more time intensive.

As strange as it may seem, the quality does not affect the final size of the Flash movie file (.swf). The bit rate of the MP3 sound is the same regardless of the quality setting. Again, we'll use an analogy — consider the file sizes generated by three different digital cameras that have the same number of pixels in the pictures. The best camera, which will have the highest quality lens and

recording mechanism, produces better-looking pictures that capture detail and produces the same file size as the others. This is one of the few times where it's not about the amount of information stored in the compressed file — it's a matter of the accuracy and quality of the information within that quantity.

If you want to avoid the wait for Flash 8 to publish Flash movies that use MP3 compression, we recommend that you compress your source audio files to the MP3 format (including support for VBR — Variable Bit Rate — compression) and import those MP3 files into Flash 8. Unless the MP3 sound file is used for Stream Sync audio, Flash 8 will export the audio in its original MP3 compressed format.

For more information on sound in Flash movies, read Chapter 15, "Adding Sound."

image from book

Using the Bandwidth Profiler

Do you want to know how long it will take for a 28.8 kilobits per second (Kbps) modem to download your Flash movie or scene? How about a 36.6 Kbps modem? Or a 56 Kbps modem? Or a cable modem? The Bandwidth Profiler enables you to simulate any download speed.

On the CD-ROM 

See the ch21 folder of this book's CD-ROM for a Flash document named bandwidth.fla. We use that Flash document for this section.

To use the Bandwidth Profiler, you first need to create a movie or scene to test. When you create a Flash movie with the Control ð Test Movie or Scene commands, Flash opens the .swf file in its own window.

View Menu

The Test Movie or Test Scene viewing environment opens your Flash movie in a dedicated window with its own View and Control menus.

Note 

On the Mac, the View and Control menus appear in the application menu bar, not in the Test Movie window.

The first three commands in the View menu are the same as those of the Flash Player plug-in viewing controls, while the others are specific to the testing environment:

  • Zoom In: Selecting this option enlarges the Flash movie. The shortcut key for this command is Ctrl+= or z+=.

  • Zoom Out: Selecting this option shrinks the Flash movie. The shortcut key for this command is Ctrl+-or z+-.

  • Magnification: This submenu enables you to change the zoom factor of the movie. The Flash movie is displayed at the original pixel size specified in the Modify ð Document dialog box when 100 percent (Ctrl+1 or z+1) is the setting. For example, if the movie size is 500 x 300 pixels, it takes up 500 x 300 pixels on your monitor. If you change the size of the viewing window, the movie may be cropped. The lower section of this submenu enables you to change the viewable area of the Flash movie.

    Note 

    In the Test Movie environment, only the 100% and Show All options are enabled in the View menu. The other magnification options are enabled in the authoring environment.

  • Bandwidth Profiler: To view the Bandwidth Profiler in this new window, use View ð Bandwidth Profiler (Ctrl+B or z+B). The viewing window will expand to accommodate the Bandwidth Profiler. Here's a breakdown of each section of the profiler:

    • The left side of the profiler displays three sections: Movie, Settings, and State. Movie indicates the dimensions, frame rate, size (in KB and bytes), duration, and preload (in number of frames and seconds). The Settings area displays the current selected connection speed (which is set in the View ð Download Settings menu). State shows you the current frame playing and its byte requirements. If you're using the Simulate Download feature (discussed later in this section), the State section displays the percent of the movie that has loaded.

    • The larger right section of the profiler shows the timeline header and graph. The lower red line beneath the timeline header indicates whether a given frame streams in real time with the current modem speed specified in the Control menu. For a 28.8 Kbps modem, any frame above 200 bytes may cause delays in streaming for a 12 frames per second (fps) movie. Note that the byte limit for each frame is dependent on frame rate. For example, a 24 fps movie has a limit of 120 bytes per frame for a 28.8 Kbps modem connection.

    • When the Bandwidth Profiler is enabled, two other commands are available in the View menu: Streaming Graph (Ctrl+G or z+G) and Frame By Frame Graph (Ctrl+F or z+F).

  • Streaming Graph: By default, Flash opens the Bandwidth Profiler in Streaming Graph mode. This mode indicates how the Flash movie streams into a browser (see Figure 21-1). Alternating light and dark gray blocks represent each frame. The size of each block indicates its relative byte size. For our bandwidth.swf example, all the frames will have loaded by the time our Playhead reaches frame 13 when the movie is played over a 56 Kbps connection. The shortcut key for Streaming Graph is Ctrl+G or z+G.

  • Frame By Frame Graph: This second mode available to the Bandwidth Profiler lays each frame side by side under the timeline header (see Figure 21-2). Although the Streaming Graph enables you to see the real-time performance of a Flash movie, the Frame By Frame Graph enables you to more easily detect which frames are contributing to streaming delays. If any frame block goes beyond the red line of the graph (for a given connection speed), then the Flash Player halts playback until the entire frame downloads. In the bandwidth.swf example, frame 1, weighing in at 420 bytes, is the only frame that may cause a very slight delay in streaming when the movie is played over a 28.8 Kbps connection. The remaining frames are right around 200 bytes each — right at the threshold of 200 bytes per frame for a 28.8 Kbps modem connection playing a 12 fps Flash movie. The shortcut key for Frame By Frame Graph is Ctrl+F or z+F.

    Note 

    If you use Flash 8's new document title and description fields in the Document Properties dialog box (Modify ð Document), you add bytes to the first frame of your Flash movie. Depending on the number of characters you type into the title and description, you shouldn't see much more than a few hundred bytes added to your overall .swf file size.

  • Simulate Download: When the Simulate Download option is enabled, the Bandwidth Profiler emulates the chosen modem speed (in the View ð Download Settings menu) when playing the Flash movie. The Bandwidth Profiler counts the bytes downloaded (displayed in the Loaded subsection of the State heading), and shows the download/play progress via a green bar in the timeline header.

    Note 

    In versions of Flash prior to Flash MX 2004, the Simulate Download feature was called Show Streaming.

    Tip 

    The Simulate Download command also applies to loaded runtime assets, such as SWF, JPEG and MP3 files. For example, when a loadMovie() action begins to load another file, the left side of the Bandwidth Profiler shows the progressive download at the simulated download speed.

  • Download Settings: The View menu also features a submenu of connection speeds, which work in tandem with the Streaming and Frame By Frame Graphs:

    • 14.4, 28.8, 56K, DSL, T1: These settings determine what speed the Bandwidth Profiler uses to calculate estimated download times and frame byte limitations. Notice that these settings use more practical expectations of these modem speeds. For example, a 28.8 modem can theoretically download 3.5 kilobytes per second (KB/s), but a more realistic download rate for this modem speed is 2.3 KB/s.

    • User Settings 6, 7, and 8: These are user-definable speed settings. By default, they are all 2.3 KB/s.

    • Customize: To change the settings for any of the modem speeds listed previously, use the Customize command to input the new value(s).

  • Quality: The Quality submenu controls the visual appearance of graphics within the Flash movie. By default, all graphics are displayed at High quality. You can choose from Low, Medium, or High quality in this menu.

  • Show Redraw Regions: This new option in Flash 8 enables you to see which areas of the Flash movie are being updated on the screen. For example, if you have a Graphic symbol animation playing in the movie, a red outline frame appears around that portion of the Stage. Any and all redraw regions are bounded by such a red frame. You can use this feature to determine how much work the Flash Player is doing to redraw the Stage — many performance and playback issues are the direct result of too much screen redrawing.

image from book
Figure 21-1: The Streaming Graph indicates how a movie will download over a given modem connection. Shown here is our bandwidth.swf as it would download over a 56 Kbps modem.

image from book
Figure 21-2: The Frame By Frame Graph shows you the byte demand of each frame in the Flash movie.

Control Menu

Use the Control menu to play (Enter key) or rewind (Ctrl+Alt+R or z+Option+R) the test movie. Rewinding pauses the bandwidth.swf movie on the first frame. Use the Step Forward (. or > key) and Step Backward (, or < key) commands to view the Flash movie frame by frame. If a Flash movie doesn't have a stop() action on the last frame, the Loop command forces the player to infinitely repeat the Flash movie.

You can use the Disable Keyboard Shortcuts command to turn off the shortcut keys for all of the commands available in Test Movie mode. This is especially useful if you have enabled interactive key presses within ActionScript for your movie. For example, if you enable the Return or Enter key for a button, it will conflict with the Play command (Control ð Play). As such, when you press the Enter key while you test your movie, the movie will play to the next frame and the button actions will be ignored.

Debug Menu

The Debug menu contains List Objects and List Variables commands. List Objects can be used to show the names of Movie Clip instances or ActionScript Objects in the Output window, while the List Variables command displays the names and values of any currently loaded variables, ActionScript objects, and XML data.

Cross Reference 

We'll discuss how these features can be used in Chapter 32, "Managing and Troubleshooting Flash Movies."

Using the Size Report

Flash also lets you view a text file summary of movie elements, frames, and fonts called a size report. In addition to viewing Frame By Frame Graphs of a Flash movie with the Bandwidth Profiler, you can inspect this size report for other "hidden" byte additions such as font character outlines. You can enable the size report to be created by accessing the Publish Settings dialog box (File ð Publish Settings), clicking the Flash tab, and checking the Generate size report option. Once enabled, you can view the size report in two ways:

  • After you publish, publish preview, or export a Flash movie, go to the folder where the .swf file was created. In that folder, you'll find a text file accompanying the Flash movie. This file is named after your Flash movie's name, followed by "Report" and the .txt file extension, as in bandwidth Report.txt.

  • When you test your Flash movie using the Control ð Test Movie command, the Output panel opens automatically in front of the Test Movie window. The report automatically loads into the Output panel.

On the CD-ROM 

A sample size report, called bandwidth Report.txt, is included in the ch21 folder of this book's CD-ROM.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net