Let me give you a little explanation of what I'm trying to do first. I'm working on a new AS3 based architecture and I'm trying to fix some issues I had in the past with AS2. Each screen has its own FLA, and multiple screens reference certain components; a Button
for example. The problem occurs when something in Button
changes. Every single screen that uses Button
has to be republished or else it has a chance that it won't pick up the change due to how Flash class definitions work: The first Button
definition that loads at runtime is the one that everything uses. So if a screen using the old Button
loads first then everything will be using the old definition and things will break. It can take an hour or more to figure out which FLA needs to be exported to fix it since there are so many and the connection between them isn't always obvious. So as you can see, this is a major time sink that needs to be fixed.
I've learned that in AS2 you can use an exclude.xml file to exclude class definitions from the SWF when the FLA is published. In this way, I figured out an architecture I can set up where there is a Shell
SWF that is the only place where the Button
class is defined. Shell
then loads in all of the other screens that all have Button
excluded so that they only pick up the Shell
version. This makes sure that if anything in Button
changes, the only thing that needs to be republished is the Shell
and then everything else picks up the change at runtime.
This is all well and good, except that when using AS3 the exclude.xml file no longer works. Because of this I've turned to MXMLC, which can mimic the exclude.xml functionality by using the -link-report
compiler option to build the exclude.xml when compiling the Shell
SWF, and then pass that XML to -load-externs
on every other screen to exclude everything that is built by the Shell
. The only way I've found to do this is by publishing everything as a SWC from Flash and then using -include-libraries
to build the SWF from the SWC along with the -load-externs
to exclude everything I don't want to be there. This does the trick just fine, except that publishing as a SWC does not include anything defined on the timeline or, more specifically, the stage. A lot of design work is done on the timeline in Flash by layering on the different parts and dropping in named MovieClips
all over the place that are then referenced in ActionScript, but the SWC doesn't pick up any of this information as far as I can tell.
So now we come to my question. Is there some way to compile all of the information in a FLA using MXMLC so that I can exclude everything while still being able to design out everything on the timeline/stage?
I sent an email to Grant Skinner and he basically said the only way he knew of to do excludes with AS3 was with RSL or SWC. He wasn't entirely sure which method worked since it had been a long time, so I don't have a definitive answer. I spent a while trying to figure it out using SWCs, but I didn't really get any decent results from it so I'm giving up for now.
The important part to note is that it is indeed impossible to run MXMLC to build a FLA. Or at least if it is possible, it requires very complex knowledge that not many people know.