How to Build Preloader Movies With Flash

How to Build Preloader Movies With Flash thumbnail
Indicating the percentage of a Flash file that has loaded is a common approach.

Preloaders are used frequently with Flash work. If your Flash content is being viewed over the Internet, the speed at which it loads will depend on the user's connection. Therefore, it's important to indicate the loading status of a Flash file, so that the user can see how long it's likely to take. Just being able to see that the load is progressing makes people more inclined to wait, rather than to become impatient and simply browse away from your page. As well as being a useful tool, preloaders can also be an opportunity to create an attractive introduction to your Flash work.

Instructions

    • 1

      Create your Flash file and choose the document properties you need, inserting elements such as media items and symbols. There are two approaches to using preloaders in Flash. You can set up a preloader within the file itself, with the preloader indicating the loading progress of the file it's inside. Alternatively, you can create a separate Flash file purely for loading. This involves one Flash file loading in a separate file as an SWF, indicating the loading status from the parent file.

    • 2

      Listen for loading information. If you're using a separate loader file, insert ActionScript code to load the second SWF. In ActionScript 2.0, you can use the MovieClipLoader Class with a Listener Object added to detect loading, where a second SWF is being loaded. If you're listening for the current file loading, you can use the ".getBytesLoaded()" and ".getBytesTotal()" methods. For ActionScript 3.0, you can use the Loader and URLRequest Classes to load a separate file. To listen for loading progress, use the "contentLoaderInfo" or "loaderInfo" elements either of the Loader object or the current movie. (See References 1, 2, 3)

    • 3

      Indicate the loading status to users. Flash has existing components that you can use to indicate loading progress, but you can also create your own. Depending on the purpose of your Flash file, you could create a loader that complements its style and function. A common practice is to use an image and mask, moving the mask to increase how much of the image is visible as the content loads. (See References 1, 2, 3)

    • 4

      Listen for completion of loading and carry out any other setup tasks within your code. You should also make sure any graphics or Movie Clips you used to indicate loading are hidden or removed when the load is complete. If your Flash file is interactive, you may wish to disable any interactive elements while the file is being loaded, only enabling them for user interaction when loading is complete. Load completion can be detected using the same Classes as load progress, except listening for the "onLoadComplete" event in ActionScript 2.0 and the "COMPLETE" event in ActionScript 3.0 for separate files loading. For loading the current file, simply check whether the percentage loaded has reached 100. (See References 1, 2, 3)

    • 5

      Upload your Flash work to a Web server and check that the loading functions work when viewed over the Internet. Make sure you test in different browsers and on different operating systems, as Flash loading can behave in different ways. It's also advisable to check the loading when viewed through an internal network -- for example, when browsing on a computer that is on a business network or intranet.

Tips & Warnings

  • Taking the time to create a preloader is always worthwhile, as it makes your Flash work accessible to a wider range of users.

  • Don't assume that your Flash loading will happen as quickly for others as it does for you. Different users will have vastly different download speeds.

Related Searches:

References

Resources

  • Photo Credit 20% violet image by Kho from Fotolia.com

Comments

You May Also Like

Related Ads

Featured