Using Resource-Shared Libraries
Tricks with a tiny preloader .swf can give users the feeling that your application loads quickly, but you should also endeavor to make the main application load as quickly as possible. A typical enterprise Flex RIA consists of several .swf files (the main application, fonts and styles, and modules) as well as several .swc libraries (both yours and the Flex framework’s). Your goal with these remains the same: ensure that only a minimum portion of the code travels over the network to the end user’s machine.
How to Link Flex Libraries
Right-click on a project name in Flash Builder, select the Flex Build Path option, and you’ll see a “Library path” panel similar to the one in Figure 8-4. This panel lists only the libraries from the Flex framework (AIR applications have some additional libraries). Both the framework and the necessary libraries must be linked to your project. You set the linkage method for the Flex framework via the “Framework linkage” drop-down menu (more on this in the next section). For now, however, just concentrate on linking the Flex libraries that your project needs for successful compilation and execution. To do this, click on the plus sign by the library name (see Figure 8-4) and double-click on the link method. You can choose one of three methods:
Merged into code
Figure 8-4. The library path of a simple Flex project
A typical ...