Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
Like this article? We recommend

Runtime Sharing: The Really Cool Part

So now that you've got a handle on authortime sharing, it's time to do something a little more stylish: runtime sharing. This technique will help you cut down on file size by importing assets from a shared library into other movies while they are running. Again, it's very simple to do.

  1. Open up the copy of Shapes.fla you still have on your Desktop and open the Library for that file.

  2. Right-click (Ctrl_click for Mac) on the Box symbol in the Library and choose Linkage.

  3. Checkmark the option called Export for runtime sharing. This will give the ability to give the Box symbol and identifier and specify from where the symbol will be exported.

  4. The name Box should appear automatically in the Identifier field. If it doesn't, enter it. Leave the checkmark for Export in first frame alone.

  5. In the URL field, type Shapes.swf. This is the name of the file that will contain the Box symbol. See Figure 7 to make sure everything matches. Then Click OK.

  6. Figure 7Figure 7 Linkage Properties. Even more fun.

  7. Repeat these steps for the other two symbols, giving them identifiers of Circle and Triangle. You'll notice that as soon as you click the Export for runtime sharing option in the Linkage dialog box for these symbols, the Identifier and URL files are filled in automatically. Flash figures that because you're exporting one asset from Shapes.swf, you'll want the others to use the same filename.

  8. Save your work and publish the movie by choosing File > Publish. Then close Shapes.fla.

  9. Open up yet another blank document and open the Library for the new. FLA. This time, save the file as receiver.fla to your Desktop.

  10. Choose File > Import > Open External Library again and choose Shapes.fla from your Desktop.

  11. Drag an instance of the Box symbol onto the Stage. Notice that it once again adds a copy of the symbol into the Library for receiever.fla.

  12. Right-click on the Box symbol in the Library for the receiver.fla and choose Linkage. This time, you'll see that the Linkage Properties dialog box has Import for runtime sharing already checked, and the URL field says Shapes.swf (see Figure 8). This means that receiver.fla will grab the asset from Shapes.swf instead of making a full copy of the symbol into its own Library. Click OK to close the Linkage dialog box.

  13. Figure 8Figure 8 Shared assets...served up hot and fresh.

  14. Choose Control > Test Movie to generate a .SWF. In the Preview window, choose View > Bandwidth Profiler. Notice that for Size, the Bandwidth Profiler says 0. Because the Box symbol is not stored in the Library for this movie (it is pulled from Shapes.swf), the asset does not add any file size to this file.

  15. Close the Preview window, save your work, and quit Flash.

If you had 10 assets in a shared library, and used them all in 15 different movies on a Web site, the assets in the shared library would have to load only once to the user's computer. And none of those assets would add any file weight at all to the movies using them. This is the magic of shared libraries.

  • + Share This
  • 🔖 Save To Your Account