Specifications

199ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
RSL considerations
RSLs are not necessarily beneficial for all applications. You should try to test both the download time and startup
time of your application with and without RSLs.
Standard RSLs can not be shared across domains. If a client runs an application in domain1.com and uses an RSL,
and then launches an application in domain2.com that uses the same RSL, the client downloads the RSL twice
even though the RSL is the same. You can overcome this limitation of standard RSLs by using cross-domain RSLs.
Cross-domain RSLs can be loaded by any application, even if that application is not in the same domain. They do,
however, require that you create and check a digest when the RSL is loaded. This can increase startup time of the
application by a small amount.
Framework RSLs can also be loaded by any application. To take advantage of the fact that framework RSLs can be
cached in the Player cache, the client must be running a recent version of Flash Player. Not all clients necessarily
have the latest Player, so loading a framework RSL might fail. In these cases, you can specify a failover RSL.
An RSL usually increases the startup time of an application. This is because the entire library is loaded into a Flex
application regardless of how much of the RSL is actually used. For this reason, make your RSLs as small as
possible. This contrasts with how statically-linked libraries are used. When you compile a Flex application, the
compiler extracts just the components it needs from those component libraries.
If you have several applications that share several libraries, it might be tempting to merge the libraries into a single
library that you use as an RSL. However, if the individual applications generally do not use more than one or two
libraries each, the penalty for having to load a single, large RSL might be higher than it would be to have the appli-
cations load multiple smaller RSLs.
In this case, test your application with both a single large RSL and multiple smaller RSLs, because the gains are
largely application specific. It might be better to build one RSL that has some extra classes than to build two RSLs,
if most users will load both of them anyway.
If you have overlapping classes in multiple RSLs, be sure to synchronize the versions so that the wrong class is
never loaded.
You cannot use RSLs in ActionScript-only projects if the base class is Sprite or MovieClip. RSLs require that the
applications base class, such as Application or SimpleApplication, understand RSL loading.
About caching
RSLs are cached when they are first used. When they are needed by another application, they can be loaded from
the cache rather than across the network. Caching is one of the benefits of RSLs, because disk access is much faster
than network access.