One of the best ways to improve the download time of Flash is to only load what is needed, when it is needed. That way you don’t waste your end user’s time by downloading things they will never potentially see. Given how short our attention spans are, and how quickly we will leave a site if it takes to long to load (5 – 7 seconds in some cases) it is nearly required that you load content externally so you can get the main information visible fast.
Flash allows you to load external content, only calling the content you need, as you need it. This keeps the initial download small. What needs to be done if figured out what needs to load initially, and what can be loaded at a later time.
If/When dealing with a flash based website, the menu, and background have to be loaded initially. However, the “pages” of the Flash site don’t need to be loaded until it is completed.
Loading External SWF Files
You will need to use a Loader object to bring in the external files.
var myLoader:Loader=new Loader();
Then you will need to create a listener for your button objects, so that when they are pressed, the actionscript will then call the myLoader object.
Loading the external file requires that you get a URLRequest object to identify the file. The files, as shown in the book, are in the same directory as the main flash document.
You can position your files in different locations, however, most people leave them at the default location.
Loading External Images
This is done the same way as the external SWF. However, instead of loading the .swf file in the URLRequest object, you specify a .jpg, or other supported image file.