Accessing Items in Shared Libraries Flash

Flash 5 adds an exciting new feature to asset management in Flash movies: the capability to link external .SWF files (and the symbols, sounds, bitmaps, and font symbols within) to each Flash movie that you use on your Web site. These external .SWF files, called Shared Libraries, are different than loaded .SWF files.
A Shared Library .SWF doesn’t load into a Level or a Movie Clip instance location.

Instead, you set up a the Library of a Flash movie (.FLA file) with assets that you want to use in other Flash movies. This movie is the basis of the Shared Library .SWF file. After you assign an identifier to each asset in the Library, you save the .FLA file, publish a .SWF file, and close the .FLA file. Then, you open another Flash movie .FLA file, and using File➪Open as Shared Library, you open the Shared Library .FLA file. Its Library window will open (in a dimmed gray state), and you can drag and drop assets to your new Flash movie file.

After you have established a Shared Library file, any changes to the actual contents of the Shared Library .FLA and .SWF files will propagate to any Flash movie that uses the shared assets. In the following sections, you learn how to create a Shared Library file and use it with other Flash movies.

Setting up a Shared Library file
To share assets among several Flash files, you need to establish a Shared Library file (or files) that is available to other Flash movie files. To create a Shared Library file:

  1. Open a new Flash movie (Ctrl+N or Command+N).
  2. To place Flash artwork into the Library, draw the shapes and other elements (text, lines, gradients, and so on). Select the artwork and convert it to a Flash symbol. Choose a symbol type (for example, Graphic, Button, or Movie Clip) that best suits the nature of your artwork.
  3. To place bitmaps and sounds into the Library, import the source files as you normally would, using File➪Import (Ctrl+R or Command+R).
  4. Delete all artwork that you have placed on the Stage. Every asset that you want to share should be in the Library.
  5. To place an entire font (or typeface) into the Library, open the Library (Ctrl+L or Command+L), and choose New Font from the Options menu, located at the top-right corner of the Library window. In the Font Symbol Properties dialog, type a reference name for the font, choose the font face from the Font menu, and select a faux font Style (Bold or Italic) to be applied (optional).
  6. Give each embedded font face a descriptive name that indicates its functionality within the Flash movie.

    Give each embedded font face a descriptive name that indicates its functionality within the Flash movie.

Assigning names to assets
After you have placed each asset into the Library of your starter .FLA file, you’ll need to assign a unique identifier to each asset.

  1. Select the symbol, bitmap, sound, and font in the Library. Choose Linkage from the Library’s Options menu.
  2. In the Symbol Linkage Properties dialog, shown in Figure below, choose Export this symbol for the Linkage option. This forces the asset to export with the published .SWF file. Then, type a unique name in the Identifier field. Click OK.
  3. Each asset in the Library of the Shared Library .FLA file needs a unique name.

    Each asset in the Library of the Shared Library .FLA file needs a unique name.

  4. Repeat Steps 1 and 2 for each asset in the Library.

Specifying the Shared Library’s location
An optional setting for the Shared Library .FLA is the relative or absolute path (as a URL) to the Shared Library .SWF on your Web server. You only need to specify this URL if you plan to store the Shared Library .SWF file within a different directory on the Web server, or on a completely different Web server.

  1. In the Options menu in the Library window, choose Shared Library Properties.
  2. In the URL field, type the location of the Shared Library .SWF file (or where you intend to publish it on the Web). This location will be preappended to each shared asset’s identifier in the movies that use the assets.

Publishing the Shared Library .SWF file
After the assets of the .FLA file have been assigned identifiers and the URL of the Shared Library has been set (optional), you need to publish a .SWF version of the .FLA file.

  1. Save the .FLA movie. Use a descriptive name that notifies other members of your Web production team that this is a Shared Library file, such as sharedLib.fla.
  2. Publish the Flash movie as a .SWF file. No other publish formats are necessary. In the Publish Settings (File➪Publish Settings), select only the Flash format in the Format tab. Click OK. Choose File➪Publish to create a .SWF file from your .FLA file.
  3. Close the .FLA file.

Linking to assets from other movies
After the Shared Library .SWF file is published, you can use the shared assets in other Flash movies.

  1. Create a new Flash movie, or open an existing one.
  2. Using the File➪Open as Shared Library command, browse to the folder where your Shared Library .FLA was saved. For testing purposes, you should keep this .FLA file in the same folder as the .FLA files that share it. Select the Shared Library .FLA file, and click Open. A separate grayed-out Library window for the Shared Library .FLA file will open in the Flash authoring environment.
  3. Drag the asset(s) that you wish to use into the new Flash movie’s Library and onto its Stage. Even though Flash will copy the contents of each shared asset, the asset will load from the separate Shared Library .SWF file.
  4. To see whether an asset is native to the Flash movie or from a Shared Library .SWF file, right-click (or Control-click on the Mac) the symbol or asset in the Library. Select Linkage from the contextual menu. The Symbol Linkage Properties dialog, will indicate whether the symbol (or asset) will be imported from an external Shared Library .SWF file.

If a Shared Library asset is used in another movie, the Symbol Linkage Properties will indicate the name (and path) of the Shared Library .SWF file.

Shared Library asset is used in another movie, the Symbol Linkage Properties will indicate the name (and path) of the Shared Library .SWF file.

When you are done dragging the assets from the Shared Library file, close its Library window. When you publish the new Flash movie(s) that use the Shared Library .SWF file, make sure you put all of the files on your Web server for live testing.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Flash Topics