Archive
This is an archived tutorial about Flash. It's kept for history and may reference outdated tech.
TL;DR
A shared library lets multiple movies use the same assets, so visitors download them only once. Export a symbol in library.fla for runtime sharing with the URL library.swf, publish it, then drag that symbol from the opened external library into another movie, where it's imported without adding to that movie's file size.
- It's especially useful for large bitmaps, sounds, fonts, and components used across multiple movies, and the process is the same for each.
- Nested symbols must also be exported for runtime sharing, or they'll be imported as regular symbols.
- Republishing the shared library updates movies importing a symbol without republishing them; to refresh the copy in an importing library, right-click it and choose Update.
A shared library allows multiple movies to use the same assets, which means that the user will only have to download them once no matter how many movies they are used in. This is useful with large bitmaps, sounds, fonts and components which can be very large, especially when used in multiple movies.
Lets start by creating our shared library. Create a new Flash document and save it as library.fla somewhere on your hard drive. Now create a new symbol (Insert > New Symbol), call it circle and set the symbol type as movie clip.

[ the Create New Symbol window ]
If your advanced tab isnt open yet, open it by pressing the Advanced button. Now check the Export for runtime sharing check box. Youll notice that the URL field becomes active; this is where you type the path to your shared library. For this example all of our movies will be in the same directory, so just type library.swf. If your shared library is located in another directory, this field must reflect that using the appropriate path.

[ set your Linkage URL value to library.swf ]
Save library.fla again, publish it and close the document. Now create a new document and save it as myMovie.fla in the same directory as library.fla. Now go to File > Import > Open External Library and select library.fla. This will simply open library.flas library. Drag the circle movie clip from the shared library to the library of myMovie.fla. If you right click in the circle symbol in myMovie.flas library and select linkage, youll see that the symbol is being imported for run-time sharing.

[ select Import for runtime sharing and enter library.swf ]
Thats it. The symbol is now being imported from library.swf and will not add to
myMovie.swfs file size. The process is the same for all symbols as well as
bitmaps, sounds and fonts.
The source files for the above example can be found here:
Note
- If you export a symbol for runtime sharing that has nested symbols, those symbols must also be exported for runtime sharing. Otherwise, those symbols will be imported as regular symbols, not shared with the external library.
- If you change the symbol in the shared library, the changes will not be reflected in the libraries movies importing them until you update the symbol. To do this, right-click on the symbol in the library of the importing movie and select Update. On the window that pops up, select Update again and the symbol will be updated.

-
If you modify the symbol in the shared library and republish it, the new symbol will be used in any other movie importing it without republishing the other movies.
All in all, shared libraries are very easy to use and can save a lot of bandwidth as well as reduce downloading times for your viewers.
Before you go, here are a few things you can do:
-
Keep reading
Read the next article in the series, Hide/View the Scrollbar Component, or check out some related content:
-
Ask a question
Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums.
Your support keeps this site going! 😇
- Jesse Marangoni aka TheCanadian