Chapter 16. Using Preloading Sequences


graphics/chic01.gif

Although Flash is great at creating bandwidth friendly files, even Flash files don't load instantaneously, and that can cause unexpected problems. Imagine that you have a Flash movie with a really slick navigational interface that loads on the first frame of your movie. Imagine what happens if a user presses one of your navigational buttons before the frame where the content lives actually loads. Oops. Bad user experience. Wouldn't it be better to set the file up so that the user doesn't see the button until you know the content has finished downloading?

What if you had a large soundtrack file in the first frame? Remember that a frame won't play until all the content for the frame has downloaded. Someone hits your site and sits there and sits there until the sound has downloaded and starts to play ( assuming you're not streaming it). You could create a better user experience by letting your visitors know what's going on.

People are more likely to wait for a file to download if you tell them that they need to do so. You really want to make them happy? Tell them how long they'll need to wait. That's where preloaders come in.

Preloaders use ActionScript to let you put your movie on "pause" until you've loaded enough of the content for your movie to play back properly. In this chapter, you take a look at different ways to approach preloading your Flash content:

  • Using _framesloaded and _totalframes. You can use these properties to determine what percentage of the total number of frames in the movie has currently loaded.

  • Using getBytesLoaded() and getBytesTotal(). These two methods are new to Flash 5 and enable you to more accurately calculate how much of the file has loaded.

  • Showing true percent loading. If you really want your visitors to stick around, let them know how long they'll have to wait by showing them how much of the file has loaded.

  • Preloading an external file. Many times, you'll find that the best way to conserve bandwidth is to break up your movie into multiple movies and load the individual movies as needed. You can set up preloaders for your external files as well as your main file.

  • Using a simple game to distract your users. Sometimes the easiest thing to do is to distract your audience. Give them something to do. A simple low-bandwidth game can keep them occupied while your movie finishes downloading.

Now, roll up your sleeves and get to work.



Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

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