views:

32

answers:

1

I would like to compile my view classes into an SWC from flash, and compile the rest of the application using mxmlc (avoiding recompiling through the IDE). However, because the view classes (source) are in the project class path, mxmlc gives them precedence over the compiled SWC.

Now I'm thinking that maybe the view classes have to be separated into a separate project, but I am hesitant to do so because I don't think these classes truly constitute an independent project, and separating them out would not serve any purpose beyond working around the linking precedence problem. Furthermore, if i were to change my mind about the linkage, i would have to restructure both projects, and any common dependancies between the two projects could be messy to maintain.

How can I get mxmlc to give precedence to the SWC over the Actionscript? Or, if this is not possible, is it more common to create a separate project for the Flash-compiled library, or to isolate the Flash source in the project so that it is not included in the project class path?

A: 

is it more common to create a separate project for the Flash-compiled library, or to isolate the Flash source in the project so that it is not included in the project class path?

One isn't more common than the other really. It depends on what you are trying to achieve. For example, I often download useful libraries (tweening, jpeg encoding, etc) and put them in all into a library directory. I then just include them as additional source.

I also have a personal library that I use in several projects which is its own Flex project and I link as a SWC.

I doubt I'd want to separate classes in the same project though.

There are a few other ways to exclude files from mxmlc. This article shows one method using the compiler options -link-report and -load-externs and it seems pretty clever. So if you are comfortable hand-crafting your own xml exclude file then -load-externs could work for you too.

The other compiler options that allow you to omit the symbols include: -externs and -compiler.external-library-path.

James Fassett
Thanks for the reply, James. I read through the article you linked, and it describes a solution that i was initially thinking might solve my problem, but I realized that my problem is a bit different:My goal is to compile classes with the Flash IDE, and then have those compiled classes included in the mxmlc compile. I believe this is different from excluding classes from a SWF that is loaded at runtime by a parent.My trouble is that the source files for the SWC are in the class path, so mxmlc finds those source files before it finds the SWC.
lettertwo