Buttons
Testing and Streamlining


 

TESTING & STREAMLINING MOVIES

 

You made the best Flash movie ever, but it downloads so slowly that you could die waiting for it to show up. Isnt there a way that you can test download speeds and streamline your movies?

Why, yes there is.

Flash comes with a built in movie tester. The movie tester will show your total Flash Movie file size, and allow you to watch the movie as it would stream over the modem of your choice.

Even though the movie tester will also allow you to watch your movie, youre better off watching your movie in the Internet Explorer or Netscape by hitting F12. After all, no one on the Internet is going to be watching your movie in the Flash Tester. Use the Flash Tester for testing only.

Sadly, youll still need to test your Flash movie on slower machines. If you dont know anyone who has a slow computer, try the public library. Keep in mind that much of your playback trouble will occur because a users processor cannot handle the complex animations youve created, not because their modem is too slow. When the animation slows down on the web design course page, it's usually because the user's computer is old and busted.

 

Testing Streaming for Different Modem Speeds

In the following example, well use the awdsf site.fla file kept in the Flash Samples folder.

1.      Save your movie.
Every once in a while, Flash freezes when you test a movie.

2.      Click the CONTROL menu. Select TEST MOVIE

 

The Test Movie Window will open and you will see your movie play. Youre not testing the streaming yet

 

3.      Click VIEW-> BANDWIDTH PROFILER

A large graph should display above your Movie. The peaks above the red line in the graph will cause a delay at your selected modem speed. You can see at which frames the peaks occur.

 

4.      Click the DEBUG menu and choose your modem speed.

5.      Click VIEW-> SHOW STREAMING
The movie will begin playing again.
At the top of the Bandwidth Profiler, a green line represents the simulated load. An arrow represents the playback head.

 

The movie will play, simulating a stream.

 

Tricks You Can Use to Avoid Pauses During Load

Your files will have to load. Sometimes, its going to cause a delay. Always remind yourself about whom your target audience is. If you must load heavy file, heres some things you can do to make it less excruciating to your audience:

 

Give Em Something to Watch

Create a simple, but entertaining or informative animation that occurs before the download heavy section. The simple animation loads quickly, but takes a longer time to display. While the simple animation is playing, the complex animations get time to load behind the scenes. The trick is coming up with something that doesnt drag and that people wouldnt mind watching more than once.
A good example can be found at: http://www.eye4u.com

 

Get Loopy

Use looping movie clips that appear before the download heavy section. The movie clip will continue to loop until the next part is loaded.
A good example can be found at http://www.awdsf.com
(The TV static in the beginning is a three frame movie clip that loops while the montage clips loads)

 

Load Movies When Needed

You can use the Load Movie Action to play additional Flash movies inside of your current movie, or to switch movies without loading another HTML document.

This can be useful in larger sites to allow users to download needed sections of the Flash based site on demand. Instead of downloading the whole movie, you can design a site in sections, each section being a totally different movie. Use the Load Movie Action to call upon different parts of the website for download when needed. Load Movie allows you to treat your site like it has individual "pages" instead of one continuous timeline.

You can load a Flash movie into or on top of the current Flash movie, or you can position and size the loaded movie using movie clips.

Load Movie is most often used as a button action, but can be used as a frame action.

 

TO USE LOAD MOVIE:

  1. Select the button or frame you want the action on
  2. On the Actions Palette, choose BASIC ACTIONS-> LOAD MOVIE

 

  1. Fill in the following:
    1. URL: File path and name of the .SWF file to load
    2. Location:
      Choose Level to replace the current movie, or to load a new movie on top of the current movie. If you place the movie on top of the current movie, you can remove it later, revealing the original movie again without loading. You can use the base level movie as a home page of sorts. The Base level is "0". The only limit to how many levels you can have is your users memory.
      Use the "Unload Movie" Action to remove a movie loaded to a specific level.

      Choose Target if you want to position and size the movie using a named movie clip. Youll target the name of the movie clips instance.

 

�.       The center point of the movie clip will become the upper left corner of the loaded movie.

�.       Resize the loaded movie by adjusting the movie clips scale in the Transform Panel.

 

Use a Pre-Loader

If your web page is content heavy, it may play faster than content can stream into a users computer. You can avoid pauses in playback by making sure that the movie is loaded to a certain frame before it starts playing. Youre going to build whats called a pre-loader.

Nobody likes pre-loaders. How often have you said "Oh, goodie! I get to wait!"? Use a preloader only if absolutely necessary. The existence of pre-loaders does not give you license to build super content heavy sites. No one except your friends will stick around to view them, and your friends wont come back.

Pre-loaders make use of the "If Frame is Loaded" action. 3

When a Flash movie plays, the playback head cruises along, happily displaying the movie. If the playback head encounters an "If Frame is Loaded" action, Flash checks to see if a specified frame is loaded. If the frame is not loaded yet, the playback head ignores the action and continues on its way. A few frames later, the playback head encounters a "Go To" action that instructs it to jump back before the "If Frame is Loaded". The playback head will continue in this loop until Flash detects that the specified frame is loaded. When the specified frame is finally loaded, Flash will instruct the playback head to skip ahead of the frame containing the loop action and play the movie.

To Build a Pre-Loader

  1. Leave space at the beginning of on your timeline. Youll need at least two frames for the pre-loader.
  2. Click frame 1 and add a Keyframe (F6)
  3. On the Actions Palette, choose:
    BASIC ACTIONS-> IF FRAME IS LOADED

 

  1. Under Frame, type the frame number to be loaded
    You can also load to a specific frame label.
  2. Without closing the Actions Palette, Click:
    BASIC ACTIONS-> GO TO

 

  1. Under Frame, type 3

 

You just wrote a sentence to Flash instructing it:

"If frame "X" is loaded, go to frame 3"


On frame 2 were going to insert a action returning the playback head to frame 1. If frame "X" is loaded, the go to frame 1 action will be skipped and the movie will play.

 

  1. Add a keyframe to Frame 2
  2. On frame 2 add a Go To action
    BASIC ACTIONS-> GO TO -> FRAME 1

 

Thats it!

 

You can insert a movie clip before the If frame is loaded action if you want to show something interesting while the preloader is working. If you want to do this, your frames might look something like this:

 

Frame 1: Insert looping movie clip

Frame 3: Insert If Frame is Loaded action (If frame X is loaded, goto and play frame 6)

Frame 5: Insert Goto Action (goto and play frame 2)

Frame 6: Remove movie clip from the timeline.

 

Using a Fake Pre-Loader

Sometimes your website will be dragged down by heavy movie clips or lots of graphics.

Luckily, Flash stores everything in memory, so if you use it more than once you wont have to download the item after its first use. If you download the heavy stuff in the beginning, you can use it again later without download reprocussions. Flash will load an item even if you cant see it. That means you can put heavy graphics and movie clips on the stage and cover them up with a background-colored rectangle. Flash will not move past a frame until everything on that frame is loaded, even if you cant see what is being loaded. If all of your heavy items are staggered across ten frames in the beginning of the movie, the movie will play slowly at first, but will speed along after that.

You can give your audience something to watch while Flash is struggling across the first frames, such as a shape tweened a "loading" bar, which will grow as the playback head travels across frames.

|