Fast-Track Your Flash Site
An example of how a modularized Flash site might be put together can be seen in the layout below. This illustrates the design layout of a site I designed recently, showing the position and sizes of each .swf.
Bring Your .swfs Together
- Once Flash is opened with a new blank stage, add another layer, giving you two layers in total.
- Label the top layer "movie holder" and the bottom layer "actionscript"
- In frame one of the "movie holder" layer, add a rectangle.
- Select the rectangle and hit F8. Make it a MovieClip and call it "mc_holder".
- In the rectangle’s properties, give it an instance name of "movieholder".
- Open the MovieClip, right click the layer that contains the rectangle and select properties. Select the layer type guide, which will hide the rectangle. Remember, this MovieClip is only a nest for the external .swf that we will load in shortly, so you don’t actually need to see the rectangle. And when you return to the main .swf you’ll no longer see the rectangle, only the MovieClip.
- Next, add the actionscript:
to the first frame in the layer titled "actionscript".
- Save the movie. Now we’ll make a new movie that we’ll eventually set to load into the movie we just made.
- Start a new movie, and add a circle (or whatever element you want) to the stage.
- Save this movie as "external" (or whatever filename you used in the actionscript in step 7) and publish it. This generates an .swf called "external.swf"
- Now open the first movie we made. The external .swf will not appear in it yet, but if you publish it, the external swf will be loaded into the main .swf.
That should do it! Just remember that all .swfs should have a preloader.
I hope this article has shed some light on how to get the most out of your Flash site, and make it load as quickly as possible. Flash has taken too much criticism about its load times — these criticisms should have more rightly been directed at the designers, rather than the technology. Designers, go and make Flash proud!