With a preloader you can order one or multiple files (.swf or .jpg) to load (download) into a movieclip, thereby keeping track of the percentage downloaded and possible errors.
Preloading in Flash MX 2004
In Flash 7 a new loader class is included: MovieClipLoader. This class is not backward compatible, it works only in Flash 7 - for Flash 6 see below.Example usage
MovieClipLoader_implementation.asDocumentation
From FL_ActionScript_Ref.pdf:
This class lets you implement listener callbacks that provide status information while SWF or
JPEG files are being loaded (downloaded) into movie clips. To use MovieClipLoader features, use
MovieClipLoader.loadClip() instead of loadMovie() or MovieClip.loadMovie() to load
SWF files.
After you issue the MovieClipLoader.loadClip() command, the following events take place in
the order listed:
- When the first bytes of the downloaded file have been written to disk, the MovieClipLoader.onLoadStart() listener is invoked.
- If you have implemented the MovieClipLoader.onLoadProgress() listener, it is invoked during the loading process.
- When the entire downloaded file has been written to disk, the MovieClipLoader.onLoadComplete() listener is invoked.
- After the downloaded fileís first frame actions have been executed, the MovieClipLoader.onLoadInit() listener is invoked.
Preloading in Flash 6
- Loader class from Moock: http://www.helpqlodhelp.com/stuff/loaderclass/loaderclass1.01.zip, documentation: http://www.helpqlodhelp.com/stuff/loaderclass/LoaderClass.doc.html
- Loader class from Ralf Bokelberg: http://www.helpqlodhelp.com/blog/archives/000039.html
Additional info
Note: for Win/IE, the default limit of concurrent http processes is 2, so you can never load more than 2 objects at the same time. This is a user preference, but most users won't change the default setting. Loading more simultaneous objects won't gain you time.Links
- moockblog - Petition To Macromedia: Better Preloading API
- this has been honored by Flash 7
- O'Reilly - The Art of Flash 5 Preloading
- article by Colin Moock
-- ArthurClemens - 15 Sep 2003
Attachment: ![]() | Action: | Size: | Date: | Who: | Comment: |
|---|---|---|---|---|---|
| | action | 1309 | 15 Sep 2003 - 13:02 | ArthurClemens | Example use of MovieClipLoader |


