Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
From the author of

The Test

To make sure that this technological masterpiece is working, let's pop it into a new document and use it to load something.

  1. Open the Components panel. Nope—the component doesn't show up there yet, so don't bother looking for it.

  2. Open the options menu in the Component panel and choose Reload. Now The_Loader should appear in a folder called Custom (or whatever you named it).

  3. Create a new Flash document and drag an instance of The_Loader to the Stage.

  4. In the Load this field in the Property inspector, enter the path to an image or .swf file, as shown in Figure 3.

  5. Figure 3Figure 3 The dern thing works...I hope.

    NOTE

    Note: The onLoadProgress() method does not fire when loading assets from your own computer. The asset must be loaded over http. To test the component, simply enter the path to an image on the Web. If you don't have your own site, use the URL to an image from a Google image search. (It helps if the image you're loading has a large file size.)

  6. The Load it here field says to load the asset into _parent.clip_mc (remember, the loadItHere variable is inside the component, so _parent refers to the main timeline in this case), so add a movie clip to the stage and assign it the instance name clip_mc.

  7. Run a test movie.

Voila!

If you've followed along, the text field in the component runs a percentage count, starting at 0% and incrementing to 100%. When the image is fully loaded, the number disappears and the image is displayed.

Building this component may have been a little time-consuming, but now that you've done it, you can toss it into any project. All you have to do is enter the path to the asset and the name of the clip in which to load the asset.

This component works only with Flash Player 7, so if you want to pre-load assets in older players, you'll have to find yourself another tutorial. (Sorry.)

Until next time, happy Flashing.

  • + Share This
  • 🔖 Save To Your Account