Just upgraded from Flash Builder 4.1 to 4.6 and have a question about using Modules in an AIR application. I have a rather large Extended Desktop application that is currently broken up into three main parts. The main application contains all primary UI containers in addition to locale and style.css items. The second project only contains 'Modules' used in the main application along with locale definitions for UI items contained in the Modules. The third and final project contains an RSL that is for all business rules and data access into SQLite and calls into web services that our application requires.
The compiled modules are manually moved from the second project into the main application before an Air Native Installer is created. Currently there are about three dozen different modules spread over eight different folders. With multiple people working on this application having the three separate projects has made life easier for development and updates.
My problem with FB4.6 is the new file structure created when the modules are compiled. Before 4.6 each module would create one .swf file in the folder structure laded out for the modules. Now each folder not only contains the module .swf file but supporting .swf files like sparkskins_220.127.116.1101.swf and textLayout_18.104.22.168.swf just to name a few. Along with copies of the lib swf files used. Now when the modules are copied the supporting files need to be copied as well but the supporting files can't be moved up a level so all folders contains the modules swf files can share the same supporting swf files. Each folder needs their own copy of the supporting swf files; not good.
I read somewhere (can’t find the reference currently) that the 4.6 update changed the internal structure of modules so they only referenced the parts of the framework that they require to run which reduces the memory requirements which I like. But the part that bothers me is the fact that so many duplicates are present and has now complicated my install process greatly. Also the largest issue is the fact the some, not all modules require spark_dmv_22.214.171.12401.swf but I don’t know that until after an install has been created and the project installed on a client machine. Running the application is when it is found. When run from the IDE in debug mode or non debug mode the applications runs without issue. This is the most troubling issue.
Does anyone know what we may be doing incorrectly and/or should be doing differently?
As usual there is a trade-off. To get the smallest modules, you have to remove as much common stuff which, of course, means you have more things to manage like all those sparkskins and textlayout RSLs. In theory, you don’t have to deploy each module with its own copy of the RSLs. There are ways to set up all of your projects so that the RSLs go with the main app and get loaded into the main app instead of the module.
The simpler method is to get fatter modules by setting merged-into-code on all of the libraries. You can still use link-reports and –load-externs to kick out common stuff from the modules if you want to take the time to do that, but I don’t think you can get as small as using RSLs.
How do I setup my modules not to require each RSL to be included right beside the modules. As an example I have 8 versions of ascorelib.swf in each folder below the modules folder in my application folder. This is in addition to the version that is actually in the application folder itself.
Also why is spark_dmv_126.96.36.19901.swf required to run my application only after I deploy my installer into the client machine? This is not required when running from within the IDE, debug and non debug versions.