views:

115

answers:

2

In Flash CS5 it seems like there's an option to import .swc files into the library, but as an RSL (runtime shared library).

alt text

What's the difference between this option (swc) and using a runtime shared library .swf file?

Also, if you select a .swc file, and choose the "info" ("i") icon, there seems to be several options for .swc..."merged into code", "external", "runtime shared library":

alt text

+5  A: 

An SWC is a compiled library bundled into your application's SWF when you it's built. This creates a larger application file (which takes longer to load in a browser), and means every application launch will take the same amount of time to load. If the resulting SWF is fairly large, every launch will take a while. These libraries are "statically linked" (i.e. included in the final compiled SWF).

RSLs are compiled libraries dynamically linked to your application. You build them as separate SWFs, and add them to a project as an RSL. The compiler for your application will create a link which allows your application to use it at runtime, rather than importing it into the main SWF file. When your application launches, it will attempt to locate the RSL and load the entire library dynamically. This increases the initial load of your application; once located and loaded, however, they are cached and subsequent application launches should be pretty quick.

RSLs have many benefits, and some drawbacks. Since they are not bundled into your application, your SWF is smaller and will launch more quickly. It also allows you to separate libraries in your application which would be used by other applications. Hence, "shared" library.

It also comes with a cost, however. RSLs are (by default, I think) linked by the compiler using a checksum. You cannot simply modify an RSL which is used by other applications w/out re-compiling them to account for the changes. If you modify the RSL, you'll get an error when your application launches since the checksum it expects won't match the new version of the library.

bedwyr
Oops, i just wrote what you did. Upvoted yours, because it's nicer than mine.
Claus Wahlers
@Claus - thanks :)
bedwyr
This explanation helps a lot, but I made some edits to my question as I think I had a typo (accidentally typed .swf where I meant .swf...sorry!) See attached screenshots...
redconservatory
Ahh I see now...so RSLs don't have to just be .swf files...
redconservatory
A: 

It works similar to internal and external Javascript if you allow me that comparison. The SWC option is like embedding Javascript in the host HTML file (assets from the SWC are statically linked (in)to your main SWF). The RSL option is like having an external JS file which is loaded via <script src> from an HTML file (assets from the RSL are dynamically linked to your main SWF.

Claus Wahlers