From within a Flash SWF file, you can load other external SWF files as assets. There are several reasons to load external SWF files:
- Because a project can be broken up into multiple movies, the individual SWF files are smaller in size. Smaller files load faster, and manage memory more efficiently.
- It lets you load only the content you need based on what the user is doing in your movie.
- Multiple SWF files can be played in succession without making the browser load another HTML page. The pages don't have the pause or refresh associated with reloading.
- It gives you greater flexibility about the organization of your project assets.
- A complex user interface can be created that does not rely on a single SWF file. Many SWF files can be combined to create the interface. Combining SWF files simplifies editing, because an individual, smaller SWF file can be revised without affecting the other parts of the interface.
- Multiple authors can collaborate on the same project by working on separate FLA files.
Placing content in a separate SWF file is similar to placing content in its own movie clip symbol. The difference is that the content exists outside the main SWF file. You can also load image files, such as JPG, PNG, GIF.
To load an external SWF file from within another SWF file, use one of the following:
- The ActionScript 3.0 Loader class
- The ActionScript 2.0 loadMovie command
- The ActionScript 2.0 MovieClipLoader class