O'Reilly logo

Flash 8 Cookbook by Joey Lott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16.4. Determining Load Progress

Problem

You want to monitor the load progress for content you are loading with MovieClipLoader, Loader, Window, or ScrollPane.

Solution

Use the Macromedia v2 ProgressBar component.

Alternatively, for a smaller file size, use the Flash 8 Cookbook ProgressBar component.

If you want a completely programmatic solution, and you have used MovieClipLoader to load the content in the first place, you can use a listener object with MovieClipLoader to monitor the load progress.

Discussion

When you are loading SWF and/or JPEG content into your Flash application, one important consideration is the time it will take to load the content. Most often, you want to make sure the user is notified as to what is going on as content loads. For example, if you are loading a 50KB .swf file and the user is connecting to your application over a dial-up connection, the content will not appear right away. In the interim, you want to make sure that the user at least knows that the content is loading. Otherwise he or she may be led to think that an error has occurred.

Macromedia provides a ProgressBar component that you can use to monitor the load progress and display that progress to the user. To use the Macromedia ProgressBar with a Loader, ScrollPane, or Window component instance, complete the following steps:

  1. Add a ProgressBar instance to the stage by dragging it from the Components panel (you’ll find it in the UI Components folder) to the stage at the point where you want it to appear. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required