The idea is to have a simple SWF file that loads another SWF file. That’s its only job. This is a huge simplification because you don’t have to deal with exporting resources on different frames, the issues that surround the document class references, etc. 

(Quick Aside: while you could also use a SWF file to load another SWF file in ActionScript 2.0, you had to be very careful about how you used the “_root” variable. This is because, in ActionScript 2.0, “_root” referenced the main timeline of the original SWF file no matter how many SWF files were loaded.  In ActionScript 3.0, that issue has gone away because the “root” variable now only refers to either the current SWF file or a container in that SWF file (see Part 2 of this tutorial for more details).

To begin, go here and down the “ASTutorial 3.0.rar” file.  unzip it on your desktop. You’ll see a folder called “ASTutorial 3.0.” Inside that folder you’ll see the Preloader.swf and Preloader.fla files. This is our preloader.  You’ll also see folder called “loadedMovie,” and inside that, you’ll see the loadedmovie.fla, loadedmovie.as, loadedmovie.swf, and loadedMovie Project.flp files. The preloader loads the loadedmovie.swf file and that's the only file you need, but keep it inside the "loadedMovie" folder.

If you open Preloader.fla and loadedmovie.fla, you’ll see that their stage sizes are the same.  It is not necessary to do this, but you’ll want that if you want to replace the preloader with the download SWF file.

The main timeline of Preloader.fla has two layers, “actions” and “text.” On the “text” layer, there are two objects, a “circular arrows” movieclip with the instance name “arrows” and a dynamic text field called “percent.” Both objects are on the stage.

If you run preloader.swf, you’ll immediately see an image of the sun shining though some clouds. This image is the loadedmovie.swf, the SWF file that preloader.swf has loaded.

But because loadedmovie.swf is so small, you never saw the preloader run.

To see it run, run the Preloader.swf again (inside the Flash CS3 IDE). Then go to the VIEW menu, select the “Download settings”  item and select “56K.” Then go back to the VIEW menu and select the “Simulate download” item. Now you’ll see the preloader run.

The “circular arrows” movieclip is a just a looped animation that spins the arrows. The “percent” text field shows how what percent of loadedmovie.swf has downloaded. (Make sure that the embedded properties of “percent” are both numerals AND punctuation else you won’t see the “%” sign).

OK, now let’s look at the ActionScript on the “actions” layer.

First, in ActionScript 3.0, we use the “Loader” class to load any external resources into a flash movie.  Therefore, we’ll use it to load our SWF file.  We create a new  Loader:

var loader:Loader = new Loader();