How to Load an External SWF File in Flash

How to Load an External SWF File in Flash thumbnail
How to Load an External SWF File in Flash

The ability to load external swf files in Flash is important if you want your primary file to stay small, compact and easier for your viewers to download. Loading all information for your Flash site or movie into the main file not only bogs it down but may leave you vulnerable to scripting errors that you could otherwise compartmentalize in different swf's. Before loading an external swf file, however, there are a few steps you have to make in preparing your main file.

Instructions

  1. Prepare Your Main Movie

    • 1

      Create a new symbol in Flash that will hold your external swf file. Anything you load into this symbol will be replaced by the external swf, so it doesn't matter what you use. It is usually most convenient to draw a rectangle on the stage with the tools that is about the same size as your external swf and press F8 to turn it into a symbol. This is your container.

    • 2

      Position your container on the stage and timeline in the location where you will want your external swf to be. If the proper container is not on the stage when your ActionScript calls the external swf in, you will receive an error message and nothing will happen.

    • 3

      Give your container an instance name in the Properties Inspector panel that makes sense for whatever external .swf you are loading, especially if you will be loading many external files.

    • 4

      Use and modify the following code, placed on the timeline, to load your external swf file into your container:

      myContainer.loadMovie("myExternalMovie.swf")

Related Searches:

References

Resources

  • Photo Credit Ciaran Griffin/Lifesize/Getty Images

Comments

You May Also Like

Related Ads

Featured