Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

Using the Shared Library
       by Jesse Marangoni aka TheCanadian  |  10 January 2007

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.

Let’s 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 isn’t open yet, open it by pressing the Advanced button. Now check the Export for runtime sharing check box. You’ll 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.fla’s 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.fla’s library and select linkage, you’ll see that the symbol is being imported for run-time sharing.

[ select Import for runtime sharing and enter library.swf ]

That’s it. The symbol is now being imported from library.swf and will not add to myMovie.swf’s 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:
Shared Library Source Files.

Notes:

  1. 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.
  2. 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.

  1. 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. Please direct your questions to the kirupaForums.

Jesse Marangoni
TheCanadian 

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components

Flash Templates
CSS Templates
Dreamweaver Templates

flash menus, buttons and components
Digicrafts Components The best flash components ever!
Entheos Flash Website Templates Buy and sell FLAs at Ultrashock!
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components  Learn how to advertise on kirupa.com