views:

35

answers:

1

Hi there,

I'm trying to compile AS files using the mxmlc but the particular class depends on other classes. My command is something like this: mxmlc -includes classA classB -source-path=. com.example.com.classC.

This gave me classC.swf but when I loaded it, it was still looking for classA.swf and classB.swf. Is there anyway I can have just one swf file?

Thanks!

A: 

I assume that classA and classB are .as files. In that case, you need not use -includes option at all - just import them to your main class (ClassC), as you'd normally do and compile using mxmlc com.example.ClassC from the folder that contains the com folder.

According to this page, -includes option is to specify a list of classes to the resulting application SWF file, whether or not those classes are required at compile time. Normally a class in the source path is compiled only if it is required - ie, only if it used by some other class that is being compiler. This option tells compiler to compile a class even if it is not used in any of your classes - may be to use getDefinitionByName to create instances of that class at runtime.

Amarghosh
It seemed to work but unfortunately, the way the code works, it's still expecting those other swf files instead of creating them manually. oh well.
tteh