20.5. Creating Preloaders for Files with Exported Symbols

Problem

Your have a file that exports movie clips for ActionScript, and you want to add a preloader.

Solution

Use the same preloader principles discussed earlier in this chapter. In addition, uncheck the “Export in first frame” option for each exported movie clip within the library.

Discussion

As you learned in Recipe 11.17, you can tell Flash to export a movie clip symbol even if it is not used at authoring time. That enables you to programmatically add instances of the movie clip using ActionScript. With a few simple movie clips exported for ActionScript, you won’t likely notice any effect on the preloader. However, with many complex (particularly bitmap) movie clips that are exported for ActionScript, you may start to notice that the preloader doesn’t appear immediately. It’s possible that the preloader may not even appear until most of the file has downloaded. This is due to the default setting for movie clips exported for ActionScript—they are set to export on the first frame. Thus every exported movie clip must download before Flash will play back even the first frame.

There is a relatively simple solution, however. Although the default setting is such that Flash-exported movie clips are exported on the first frame, you can tell Flash to use an alternate frame instead, with the following steps:

  1. Uncheck the “Export in first frame” option for each movie clip symbol. You can access the option from the Linkage properties dialog ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.