Tutorials — Using SWF, Lock & Load with your own .swf files

This tutorial will show you how to use SWF, Lock & Load with your existing .swf files.


Preparing your Flash (.swf) files for preloading

When creating your flash file that you want to add a preloader to, you must add a stop action at the beginning of the movie. This will prevent the file from automatically playing while the preloader is loading the file.You should not place any other items in the first frame unless you want it to show during the preloader.


Once the preloader has finished, it will automatically resume playback on the maintimline of your Flash movie.

Flash movies will loop automatically unless you add a stop action at the end of the movie. But since we have added a stop action in the first frame, the movie will jump back to frame 1 when it has done playing and will now stop at frame 1. If you want your Flash movie to loop, you need to add a gotoAndPlay action in the last frame. Set the frame number to go to the frame number after the frame containing the stop action at the beginning of the movie. In the example, we would use gotoAndPlay(2).


If you do not want your Flash movie to loop at all, you must add a stop action to the last frame of the movie on the main timeline. Otherwise it will loop back to the first frame where there is nothing to show, since we are not placing any items in the first frame except for a stop action.

Now export the movie as a Flash movie (.swf) file (File -> Export -> Export Movie...). In this example we will export with the filename mymovie.swf.


Add the Preloader with SWF, Lock & Load

In SWF, Lock & Load, click the Browse button to choose the .swf file you just exported.


We want to keep the target movie as a separate .swf file, so choose the External Target option.


Now you can customize the preloader with the various options from the Display, Progress, Message and Imports tabs in SWF, Lock & Load.

When you are done customzing the preloader, you must export the preloader as a .swf file. (File -> Export SWF...) When the preloader is exported, paths are stored as relative paths between the preloader .swf file and the target .swf file. When you upload the files to the server, you need to use the same directory structure as you do locally. The recommended method is to just export the preloader .swf file to the same folder as the target .swf file.

Your preloader is now ready to use.In this example, the preloader.swf file will preload the mymovie.swf file.

To display on a web page, you need to display the preloader.swf and not the target swf file.