There are a couple of things that might help here.
1) There should be a way to compile LessonsCommonScripts
into your main SWF only. When you do this, you are still allowed to call it from your loaded SWFs, but it would be considered external to them, rather than included as multiple separate copies. Then, if you make changes to LessonsCommonScripts
, you can recompile the main SWF, and all of the loaded SWFs will automatically use the new version.
Assuming that you're compiling with mxmlc, I think you can use the -externs
compiler option to tell the compiler that a particular class is external. Something like this, maybe? -externs LessonsCommonScripts
(if LessonsCommonScripts
is in a package, you probably need to include that too, so -externs com.example.LessonsCommonScripts
instead). This may not be exactly right, so it might be good to experiment a bit, or try to find an example online somewhere.
2) Flash/AIR also has a concept of Application Domains. These allows you to load SWFs that may contain different versions of the same classes into their own little sandboxes so that the classes don't conflict with each other. You should be able to pass a custom ApplicationDomain
to your Loader
before you start loading the SWF.